tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
python311Packages.jenkinsapi: support new pytest
Elliot Cameron
2 years ago
36964c5d
6f9c5f5b
+41
-1
2 changed files
expand all
collapse all
unified
split
pkgs
development
python-modules
jenkinsapi
default.nix
pytest-warn-none.patch
+11
-1
pkgs/development/python-modules/jenkinsapi/default.nix
···
8
, pytestCheckHook
9
, pytz
10
, requests
0
11
, six
12
}:
13
···
21
hash = "sha256-JGqYpj5h9UoV0WEFyxVIjFZwc030HobHrw1dnAryQLk=";
22
};
23
0
0
0
0
24
nativeBuildInputs = [
25
flit-core
26
pbr
···
29
propagatedBuildInputs = [
30
pytz
31
requests
0
32
six
33
];
34
···
41
# don't run tests that try to spin up jenkins
42
disabledTests = [ "systests" ];
43
44
-
pythonImportsCheck = [ "jenkinsapi" ];
0
0
0
0
45
46
meta = with lib; {
47
description = "A Python API for accessing resources on a Jenkins continuous-integration server";
···
8
, pytestCheckHook
9
, pytz
10
, requests
11
+
, setuptools
12
, six
13
}:
14
···
22
hash = "sha256-JGqYpj5h9UoV0WEFyxVIjFZwc030HobHrw1dnAryQLk=";
23
};
24
25
+
patches = [
26
+
./pytest-warn-none.patch
27
+
];
28
+
29
nativeBuildInputs = [
30
flit-core
31
pbr
···
34
propagatedBuildInputs = [
35
pytz
36
requests
37
+
setuptools
38
six
39
];
40
···
47
# don't run tests that try to spin up jenkins
48
disabledTests = [ "systests" ];
49
50
+
pythonImportsCheck = [
51
+
"jenkinsapi"
52
+
"jenkinsapi.utils"
53
+
"jenkinsapi.utils.jenkins_launcher"
54
+
];
55
56
meta = with lib; {
57
description = "A Python API for accessing resources on a Jenkins continuous-integration server";
+30
pkgs/development/python-modules/jenkinsapi/pytest-warn-none.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
diff --git a/jenkinsapi_tests/unittests/test_build.py b/jenkinsapi_tests/unittests/test_build.py
2
+
index 2e2c2f4..9de816a 100644
3
+
--- a/jenkinsapi_tests/unittests/test_build.py
4
+
+++ b/jenkinsapi_tests/unittests/test_build.py
5
+
@@ -3,6 +3,7 @@ import pytest
6
+
import pytz
7
+
from . import configs
8
+
import datetime
9
+
+import warnings
10
+
from jenkinsapi.build import Build
11
+
from jenkinsapi.job import Job
12
+
13
+
@@ -252,7 +253,7 @@ def test_build_env_vars_wo_injected_env_vars_plugin(monkeypatch, build):
14
+
monkeypatch.setattr(Build, "get_data", fake_get_data)
15
+
16
+
with pytest.raises(requests.HTTPError) as excinfo:
17
+
- with pytest.warns(None) as record:
18
+
+ with warnings.catch_warnings(record=True) as record:
19
+
build.get_env_vars()
20
+
assert "404" == str(excinfo.value)
21
+
assert len(record) == 1
22
+
@@ -269,7 +270,7 @@ def test_build_env_vars_other_exception(monkeypatch, build):
23
+
monkeypatch.setattr(Build, "get_data", fake_get_data)
24
+
25
+
with pytest.raises(Exception) as excinfo:
26
+
- with pytest.warns(None) as record:
27
+
+ with warnings.catch_warnings(record=True) as record:
28
+
build.get_env_vars()
29
+
assert "" == str(excinfo.value)
30
+
assert len(record) == 0