mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-07 13:09:27 +03:00
Merge pull request #304651 from deshaw/jenkinsapi-support-new-pytest
python311Packages.jenkinsapi: support new pytest
This commit is contained in:
commit
d3cd77b019
@ -8,6 +8,7 @@
|
|||||||
, pytestCheckHook
|
, pytestCheckHook
|
||||||
, pytz
|
, pytz
|
||||||
, requests
|
, requests
|
||||||
|
, setuptools
|
||||||
, six
|
, six
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -21,6 +22,10 @@ buildPythonPackage rec {
|
|||||||
hash = "sha256-JGqYpj5h9UoV0WEFyxVIjFZwc030HobHrw1dnAryQLk=";
|
hash = "sha256-JGqYpj5h9UoV0WEFyxVIjFZwc030HobHrw1dnAryQLk=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./pytest-warn-none.patch
|
||||||
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
flit-core
|
flit-core
|
||||||
pbr
|
pbr
|
||||||
@ -29,6 +34,7 @@ buildPythonPackage rec {
|
|||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
pytz
|
pytz
|
||||||
requests
|
requests
|
||||||
|
setuptools
|
||||||
six
|
six
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -41,7 +47,11 @@ buildPythonPackage rec {
|
|||||||
# don't run tests that try to spin up jenkins
|
# don't run tests that try to spin up jenkins
|
||||||
disabledTests = [ "systests" ];
|
disabledTests = [ "systests" ];
|
||||||
|
|
||||||
pythonImportsCheck = [ "jenkinsapi" ];
|
pythonImportsCheck = [
|
||||||
|
"jenkinsapi"
|
||||||
|
"jenkinsapi.utils"
|
||||||
|
"jenkinsapi.utils.jenkins_launcher"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "A Python API for accessing resources on a Jenkins continuous-integration server";
|
description = "A Python API for accessing resources on a Jenkins continuous-integration server";
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
diff --git a/jenkinsapi_tests/unittests/test_build.py b/jenkinsapi_tests/unittests/test_build.py
|
||||||
|
index 2e2c2f4..9de816a 100644
|
||||||
|
--- a/jenkinsapi_tests/unittests/test_build.py
|
||||||
|
+++ b/jenkinsapi_tests/unittests/test_build.py
|
||||||
|
@@ -3,6 +3,7 @@ import pytest
|
||||||
|
import pytz
|
||||||
|
from . import configs
|
||||||
|
import datetime
|
||||||
|
+import warnings
|
||||||
|
from jenkinsapi.build import Build
|
||||||
|
from jenkinsapi.job import Job
|
||||||
|
|
||||||
|
@@ -252,7 +253,7 @@ def test_build_env_vars_wo_injected_env_vars_plugin(monkeypatch, build):
|
||||||
|
monkeypatch.setattr(Build, "get_data", fake_get_data)
|
||||||
|
|
||||||
|
with pytest.raises(requests.HTTPError) as excinfo:
|
||||||
|
- with pytest.warns(None) as record:
|
||||||
|
+ with warnings.catch_warnings(record=True) as record:
|
||||||
|
build.get_env_vars()
|
||||||
|
assert "404" == str(excinfo.value)
|
||||||
|
assert len(record) == 1
|
||||||
|
@@ -269,7 +270,7 @@ def test_build_env_vars_other_exception(monkeypatch, build):
|
||||||
|
monkeypatch.setattr(Build, "get_data", fake_get_data)
|
||||||
|
|
||||||
|
with pytest.raises(Exception) as excinfo:
|
||||||
|
- with pytest.warns(None) as record:
|
||||||
|
+ with warnings.catch_warnings(record=True) as record:
|
||||||
|
build.get_env_vars()
|
||||||
|
assert "" == str(excinfo.value)
|
||||||
|
assert len(record) == 0
|
Loading…
Reference in New Issue
Block a user