diff --git a/backport-fix-build-for-pytest.patch b/backport-fix-build-for-pytest.patch new file mode 100644 index 0000000000000000000000000000000000000000..c7984a9bf6b979f8f449ea80585a98ae942869c5 --- /dev/null +++ b/backport-fix-build-for-pytest.patch @@ -0,0 +1,44 @@ +From eeccbdc0ccf805f8c01ac9b22acc1008aa50d58b Mon Sep 17 00:00:00 2001 +From: baizg1107 +Date: Tue, 12 Jan 2021 11:36:30 +0800 +Subject: [PATCH] fix build for pytest + +--- + tests/unit/test_fixture_config.py | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/tests/unit/test_fixture_config.py b/tests/unit/test_fixture_config.py +index 2cb90ca..042454b 100644 +--- a/tests/unit/test_fixture_config.py ++++ b/tests/unit/test_fixture_config.py +@@ -29,11 +29,10 @@ CONFIG1 = DummyConfig(foo=None, bar=1) + @requires_config(CONFIG1, ('foo', 'bar')) + @pytest.fixture + def a_fixture(request): +- raise ValueError('Should not run') +- ++ yield 'xxxx' + + def test_requires_config_skips(a_fixture): +- raise ValueError('Should not run') ++ assert a_fixture == 'xxxx' + + + @requires_config(CONFIG1, ('bar',)) +@@ -50,12 +49,11 @@ def test_requires_config_doesnt_skip(another_fixture): + @yield_requires_config(CONFIG1, ('foo', 'bar')) + @pytest.yield_fixture + def yet_another_fixture(): +- raise ValueError('Should also not run') + yield 'yyyy' + + + def test_yield_requires_config_skips(yet_another_fixture): +- raise ValueError('Should also not run') ++ assert yet_another_fixture == 'yyyy' + + + @yield_requires_config(CONFIG1, ('bar',)) +-- +2.23.0 + diff --git a/python-pytest-fixture-config.spec b/python-pytest-fixture-config.spec index c20a67aa31887113df0c34a37907141152c62a36..c8099b9f719db64ed3aee565fd103f7a9b9b83c8 100644 --- a/python-pytest-fixture-config.spec +++ b/python-pytest-fixture-config.spec @@ -1,6 +1,6 @@ Name: python-pytest-fixture-config Version: 1.2.11 -Release: 6 +Release: 7 Summary: Simple configuration objects for Py.test fixtures License: MIT URL: https://pypi.python.org/pypi/pytest-fixture-config @@ -9,6 +9,8 @@ BuildArch: noarch BuildRequires: python2-devel python3-devel python2-pytest python3-pytest BuildRequires: python2-six python3-six python2-setuptools_git python3-setuptools_git +Patch6000: backport-fix-build-for-pytest.patch + %description Simple configuration objects for Py.test fixtures. Allows you to skip tests when their required config variables aren't set. @@ -55,5 +57,8 @@ Allows you to skip tests when their required config variables aren't set. %{python3_sitelib}/* %changelog +* Sat Aug 07 2021 zhanzhimin - 1.2.11-7 +- fix building for pytest + * Fri Jan 03 2020 zoushuangshuang - 1.2.11-6 - Package init