Compare commits
5 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 21a6d4255a | |||
| 10c43dd22b | |||
|
|
da6083827c | ||
|
|
7645fc4142 | ||
|
|
399155cc96 |
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:787833087014b65eb622a16f3cc9a89a4ceccc5ba3f97df9ba8bd086e98c19a4
|
|
||||||
size 7916
|
|
||||||
BIN
pytest-lazy-fixture-0.6.3.tar.gz
LFS
Normal file
BIN
pytest-lazy-fixture-0.6.3.tar.gz
LFS
Normal file
Binary file not shown.
@@ -1,3 +1,40 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon May 6 05:59:39 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Switch to autosetup and pyproject macros.
|
||||||
|
- Add numpy to BuildRequires, needed for the testsuite.
|
||||||
|
- No more greedy globs in %files.
|
||||||
|
- Add patch support-pytest-8.patch:
|
||||||
|
* Support pytest >= 8 changes.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Apr 21 12:31:46 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- add sle15_python_module_pythons (jsc#PED-68)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Apr 13 22:44:05 UTC 2023 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
- Make calling of %{sle15modernpython} optional.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Feb 20 07:16:11 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
|
||||||
|
- Update to 0.6.3:
|
||||||
|
* no changelog
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Dec 4 12:08:19 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
|
||||||
|
- Update to 0.6.2:
|
||||||
|
* minor fixes
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Nov 5 10:54:53 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
|
||||||
|
- Update to 0.6.1:
|
||||||
|
* minor fixes
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Mar 17 03:29:17 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
Sun Mar 17 03:29:17 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-pytest-lazy-fixture
|
# spec file for package python-pytest-lazy-fixture
|
||||||
#
|
#
|
||||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -16,44 +16,48 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-pytest-lazy-fixture
|
Name: python-pytest-lazy-fixture
|
||||||
Version: 0.5.2
|
Version: 0.6.3
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Helper to use fixtures in pytest.markparametrize
|
Summary: Helper to use fixtures in pytest.markparametrize
|
||||||
License: MIT
|
License: MIT
|
||||||
Group: Development/Languages/Python
|
|
||||||
URL: https://github.com/tvorog/pytest-lazy-fixture
|
URL: https://github.com/tvorog/pytest-lazy-fixture
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/pytest-lazy-fixture/pytest-lazy-fixture-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/pytest-lazy-fixture/pytest-lazy-fixture-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM (ish) Sourced from gh#TvoroG/pytest-lazy-fixture/issues/65
|
||||||
|
Patch0: support-pytest-8.patch
|
||||||
|
BuildRequires: %{python_module numpy}
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
|
BuildRequires: %{python_module pytest >= 8.0}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-pytest >= 2.9.2
|
Requires: python-pytest >= 8.0
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
# SECTION test requirements
|
|
||||||
BuildRequires: %{python_module pytest >= 2.9.2}
|
|
||||||
# /SECTION
|
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Helper to use fixtures in pytest.mark.parametrize.
|
Helper to use fixtures in pytest.mark.parametrize.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pytest-lazy-fixture-%{version}
|
%autosetup -p1 -n pytest-lazy-fixture-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%python_install
|
%pyproject_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%python_exec -m pytest
|
%pytest
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/pytest_lazyfixture.py
|
||||||
|
%pycache_only %{python_sitelib}/__pycache__/pytest_lazyfixture*.pyc
|
||||||
|
%{python_sitelib}/pytest_lazy_fixture-%{version}.dist-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|||||||
66
support-pytest-8.patch
Normal file
66
support-pytest-8.patch
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
diff --git a/pytest_lazyfixture.py b/pytest_lazyfixture.py
|
||||||
|
index abf5db5..df83ce7 100644
|
||||||
|
--- a/pytest_lazyfixture.py
|
||||||
|
+++ b/pytest_lazyfixture.py
|
||||||
|
@@ -71,14 +71,13 @@ def pytest_make_parametrize_id(config, val, argname):
|
||||||
|
def pytest_generate_tests(metafunc):
|
||||||
|
yield
|
||||||
|
|
||||||
|
- normalize_metafunc_calls(metafunc, 'funcargs')
|
||||||
|
- normalize_metafunc_calls(metafunc, 'params')
|
||||||
|
+ normalize_metafunc_calls(metafunc)
|
||||||
|
|
||||||
|
|
||||||
|
-def normalize_metafunc_calls(metafunc, valtype, used_keys=None):
|
||||||
|
+def normalize_metafunc_calls(metafunc, used_keys=None):
|
||||||
|
newcalls = []
|
||||||
|
for callspec in metafunc._calls:
|
||||||
|
- calls = normalize_call(callspec, metafunc, valtype, used_keys)
|
||||||
|
+ calls = normalize_call(callspec, metafunc, used_keys)
|
||||||
|
newcalls.extend(calls)
|
||||||
|
metafunc._calls = newcalls
|
||||||
|
|
||||||
|
@@ -98,17 +97,21 @@ def copy_metafunc(metafunc):
|
||||||
|
return copied
|
||||||
|
|
||||||
|
|
||||||
|
-def normalize_call(callspec, metafunc, valtype, used_keys):
|
||||||
|
+def normalize_call(callspec, metafunc, used_keys):
|
||||||
|
fm = metafunc.config.pluginmanager.get_plugin('funcmanage')
|
||||||
|
|
||||||
|
used_keys = used_keys or set()
|
||||||
|
- valtype_keys = set(getattr(callspec, valtype).keys()) - used_keys
|
||||||
|
+ keys = set(callspec.params.keys()) - used_keys
|
||||||
|
+ print(used_keys, keys)
|
||||||
|
|
||||||
|
- for arg in valtype_keys:
|
||||||
|
- val = getattr(callspec, valtype)[arg]
|
||||||
|
+ for arg in keys:
|
||||||
|
+ val = callspec.params[arg]
|
||||||
|
if is_lazy_fixture(val):
|
||||||
|
try:
|
||||||
|
- _, fixturenames_closure, arg2fixturedefs = fm.getfixtureclosure([val.name], metafunc.definition.parent)
|
||||||
|
+ if pytest.version_tuple >= (8, 0, 0):
|
||||||
|
+ fixturenames_closure, arg2fixturedefs = fm.getfixtureclosure(metafunc.definition.parent, [val.name], {})
|
||||||
|
+ else:
|
||||||
|
+ _, fixturenames_closure, arg2fixturedefs = fm.getfixtureclosure([val.name], metafunc.definition.parent)
|
||||||
|
except ValueError:
|
||||||
|
# 3.6.0 <= pytest < 3.7.0; `FixtureManager.getfixtureclosure` returns 2 values
|
||||||
|
fixturenames_closure, arg2fixturedefs = fm.getfixtureclosure([val.name], metafunc.definition.parent)
|
||||||
|
@@ -117,14 +120,14 @@ def normalize_call(callspec, metafunc, valtype, used_keys):
|
||||||
|
fixturenames_closure, arg2fixturedefs = fm.getfixtureclosure([val.name], current_node)
|
||||||
|
|
||||||
|
extra_fixturenames = [fname for fname in fixturenames_closure
|
||||||
|
- if fname not in callspec.params and fname not in callspec.funcargs]
|
||||||
|
+ if fname not in callspec.params]# and fname not in callspec.funcargs]
|
||||||
|
|
||||||
|
newmetafunc = copy_metafunc(metafunc)
|
||||||
|
newmetafunc.fixturenames = extra_fixturenames
|
||||||
|
newmetafunc._arg2fixturedefs.update(arg2fixturedefs)
|
||||||
|
newmetafunc._calls = [callspec]
|
||||||
|
fm.pytest_generate_tests(newmetafunc)
|
||||||
|
- normalize_metafunc_calls(newmetafunc, valtype, used_keys | set([arg]))
|
||||||
|
+ normalize_metafunc_calls(newmetafunc, used_keys | set([arg]))
|
||||||
|
return newmetafunc._calls
|
||||||
|
|
||||||
|
used_keys.add(arg)
|
||||||
Reference in New Issue
Block a user