From a592232a4ae166f75315624c5db020e2254827bdf86211763eca009a7263f2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 6 May 2020 07:00:36 +0000 Subject: [PATCH] - Add patch to work with pytest5: * pytest5.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pook?expand=0&rev=7 --- pytest5.patch | 22 ++++++++++++++++++++++ python-pook.changes | 6 ++++++ python-pook.spec | 9 +++++---- 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 pytest5.patch diff --git a/pytest5.patch b/pytest5.patch new file mode 100644 index 0000000..978d1ab --- /dev/null +++ b/pytest5.patch @@ -0,0 +1,22 @@ +From 2071da27701c82ce02b015e01e2aa6fd203e7bb5 Mon Sep 17 00:00:00 2001 +From: Tom +Date: Tue, 5 May 2020 14:22:30 +0200 +Subject: [PATCH] fix(#69): use match keyword in pytest.raises + +--- + tests/unit/matchers/base_test.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/unit/matchers/base_test.py b/tests/unit/matchers/base_test.py +index 175bd67..b01aa23 100644 +--- a/tests/unit/matchers/base_test.py ++++ b/tests/unit/matchers/base_test.py +@@ -33,7 +33,7 @@ def test_base_matcher_exceptions(): + assert _BaseMatcher('foo').match(None) is None + + with pytest.raises(ValueError, +- message='expectation argument cannot be empty'): ++ match='expectation argument cannot be empty'): + _BaseMatcher(None) + + diff --git a/python-pook.changes b/python-pook.changes index 3b29255..3127e59 100644 --- a/python-pook.changes +++ b/python-pook.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 6 06:59:43 UTC 2020 - Tomáš Chvátal + +- Add patch to work with pytest5: + * pytest5.patch + ------------------------------------------------------------------- Tue Mar 24 09:20:50 UTC 2020 - pgajdos@suse.com diff --git a/python-pook.spec b/python-pook.spec index 5846697..1e21470 100644 --- a/python-pook.spec +++ b/python-pook.spec @@ -24,9 +24,9 @@ Version: 1.0.0 Release: 0 Summary: HTTP traffic mocking and expectations License: MIT -Group: Development/Languages/Python URL: https://github.com/h2non/pook Source: https://files.pythonhosted.org/packages/source/p/pook/pook-%{version}.tar.gz +Patch0: pytest5.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -43,7 +43,7 @@ BuildRequires: %{python_module jsonschema >= 2.5.1} BuildRequires: %{python_module mocket >= 1.6.0} BuildRequires: %{python_module mock} BuildRequires: %{python_module nose >= 1.3.7} -BuildRequires: %{python_module pytest < 5} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests >= 2.20.0} BuildRequires: %{python_module urllib3 >= 1.19.1} BuildRequires: %{python_module xmltodict >= 0.10.2} @@ -55,6 +55,7 @@ HTTP traffic mocking and expectations. %prep %setup -q -n pook-%{version} +%patch0 -p1 rm -f setup.cfg pytest.ini tox.ini # Assist unittest on Python 2 @@ -72,8 +73,8 @@ touch tests/__init__.py %check %{python_expand # export PYTHONPATH=%{buildroot}%{$python_sitelib} -$python -m pytest tests/unit -$python -m pytest tests/integration/engines/pytest_suite.py +$python -m pytest -v tests/unit +$python -m pytest -v tests/integration/engines/pytest_suite.py $python -m nose tests/integration/engines/nose_suite.py export PYTHONPATH=%{buildroot}%{$python_sitelib}:. $python -m unittest tests.integration.engines.unittest_suite