python311Packages.jenkinsapi: support new pytest

+41 -1
+11 -1
pkgs/development/python-modules/jenkinsapi/default.nix
··· 8 8 , pytestCheckHook 9 9 , pytz 10 10 , requests 11 + , setuptools 11 12 , six 12 13 }: 13 14 ··· 21 22 hash = "sha256-JGqYpj5h9UoV0WEFyxVIjFZwc030HobHrw1dnAryQLk="; 22 23 }; 23 24 25 + patches = [ 26 + ./pytest-warn-none.patch 27 + ]; 28 + 24 29 nativeBuildInputs = [ 25 30 flit-core 26 31 pbr ··· 29 34 propagatedBuildInputs = [ 30 35 pytz 31 36 requests 37 + setuptools 32 38 six 33 39 ]; 34 40 ··· 41 47 # don't run tests that try to spin up jenkins 42 48 disabledTests = [ "systests" ]; 43 49 44 - pythonImportsCheck = [ "jenkinsapi" ]; 50 + pythonImportsCheck = [ 51 + "jenkinsapi" 52 + "jenkinsapi.utils" 53 + "jenkinsapi.utils.jenkins_launcher" 54 + ]; 45 55 46 56 meta = with lib; { 47 57 description = "A Python API for accessing resources on a Jenkins continuous-integration server";
+30
pkgs/development/python-modules/jenkinsapi/pytest-warn-none.patch
··· 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