diff --git a/no-makeitem-method.patch b/no-makeitem-method.patch new file mode 100644 index 0000000..0d186b0 --- /dev/null +++ b/no-makeitem-method.patch @@ -0,0 +1,40 @@ +Index: pytest-relaxed-1.1.5/pytest_relaxed/classes.py +=================================================================== +--- pytest-relaxed-1.1.5.orig/pytest_relaxed/classes.py ++++ pytest-relaxed-1.1.5/pytest_relaxed/classes.py +@@ -179,23 +179,15 @@ class SpecInstance(RelaxedMixin, Instanc + setattr(obj, name, value) + return obj + +- # Stub for pytest >=3.0,<3.3 where _makeitem did not exist +- def makeitem(self, *args, **kwargs): +- return self._makeitem(*args, **kwargs) +- +- def _makeitem(self, name, obj): +- # More pytestmark skipping. +- if name == "pytestmark": +- return +- # NOTE: no need to modify collect() this time, just mutate item +- # creation. TODO: but if collect() is still public, let's move to that +- # sometime, if that'll work as well. +- superb = super(SpecInstance, self) +- attr = "_makeitem" if hasattr(superb, "_makeitem") else "makeitem" +- item = getattr(superb, attr)(name, obj) +- # Replace any Class objects with SpecClass; this will automatically +- # recurse. +- # TODO: can we unify this with SpecModule's same bits? +- if isinstance(item, Class): +- item = SpecClass.from_parent(item.parent, name=item.name) +- return item ++ def collect(self): ++ items = super(SpecInstance, self).collect() ++ collected = [] ++ for item in items: ++ # Replace any Class objects with SpecClass, and recurse into it. ++ if isinstance(item, Class): ++ cls = SpecClass.from_parent(item.parent, name=item.name) ++ for item in cls.collect(): ++ collected.append(item) ++ else: ++ collected.append(item) ++ return collected diff --git a/python-pytest-relaxed.changes b/python-pytest-relaxed.changes index 5eb1f99..8ae2ddf 100644 --- a/python-pytest-relaxed.changes +++ b/python-pytest-relaxed.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Mar 10 06:05:48 UTC 2022 - Steve Kowalik + +- Add patch no-makeitem-method.patch: + * Support pytest > 6.1 +- No longer skip python310. + ------------------------------------------------------------------- Tue Dec 28 20:34:06 UTC 2021 - Ben Greiner diff --git a/python-pytest-relaxed.spec b/python-pytest-relaxed.spec index 22f285d..0660766 100644 --- a/python-pytest-relaxed.spec +++ b/python-pytest-relaxed.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytest-relaxed # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,6 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define skip_python310 1 Name: python-pytest-relaxed Version: 1.1.5 Release: 0 @@ -26,15 +25,16 @@ License: BSD-2-Clause URL: https://github.com/bitprophet/pytest-relaxed Source: https://files.pythonhosted.org/packages/source/p/pytest-relaxed/pytest-relaxed-%{version}.tar.gz Patch0: https://github.com/bitprophet/pytest-relaxed/pull/10.patch#/pytest-relaxed-pr10.patch +# PATCH-FIX-UPSTREAM gh#bitprophet/pytest-relaxed#21 +Patch1: no-makeitem-method.patch BuildRequires: %{python_module decorator >= 4} -# gh#bitprophet/pytest-relaxed#12 -BuildRequires: %{python_module pytest < 6.1} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-decorator >= 4 -Requires: python-pytest < 6.1 +Requires: python-pytest Requires: python-six BuildArch: noarch %python_subpackages @@ -43,12 +43,11 @@ BuildArch: noarch Relaxed test discovery/organization plugin for pytest from python-paramiko author %prep -%setup -q -n pytest-relaxed-%{version} +%autosetup -p1 -n pytest-relaxed-%{version} # do not hardcode deps sed -i setup.py \ -e 's:pytest>=3,<5:pytest>=3:' \ -e 's:decorator>=4,<5:decorator>=4:' -%patch0 -p1 %build export LANG=en_US.UTF-8