!5 Fix building for pytest update

From: @baizg1107
Reviewed-by: @overweight
Signed-off-by: @overweight
This commit is contained in:
openeuler-ci-bot 2021-01-12 16:53:12 +08:00 committed by Gitee
commit 2f6263949e
2 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,44 @@
From eeccbdc0ccf805f8c01ac9b22acc1008aa50d58b Mon Sep 17 00:00:00 2001
From: baizg1107 <preloyalwhite@163.com>
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

View File

@ -1,6 +1,6 @@
Name: python-pytest-fixture-config Name: python-pytest-fixture-config
Version: 1.2.11 Version: 1.2.11
Release: 7 Release: 8
Summary: Simple configuration objects for Py.test fixtures Summary: Simple configuration objects for Py.test fixtures
License: MIT License: MIT
URL: https://pypi.python.org/pypi/pytest-fixture-config URL: https://pypi.python.org/pypi/pytest-fixture-config
@ -8,6 +8,7 @@ Source0: https://files.pythonhosted.org/packages/source/p/pytest-fixture-
BuildArch: noarch BuildArch: noarch
BuildRequires: python3-devel python3-pytest BuildRequires: python3-devel python3-pytest
BuildRequires: python3-six python3-setuptools_git BuildRequires: python3-six python3-setuptools_git
Patch0: 0001-fix-build-for-pytest.patch
%description %description
Simple configuration objects for Py.test fixtures. Simple configuration objects for Py.test fixtures.
@ -39,6 +40,9 @@ Allows you to skip tests when their required config variables aren't set.
%{python3_sitelib}/* %{python3_sitelib}/*
%changelog %changelog
* Sat Jan 9 2021 baizhonggui<baizhonggui@huawei.com> - 1.2.11-8
- Fix building for pytest
* Fri 11 Sep 2020 wangyue<wangyue92@huawei.com> - 1.2.11-7 * Fri 11 Sep 2020 wangyue<wangyue92@huawei.com> - 1.2.11-7
- Remove python2-pytest-fixture-config - Remove python2-pytest-fixture-config