- Add patch no-makeitem-method.patch:
* Support pytest > 6.1 - No longer skip python310. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-relaxed?expand=0&rev=14
This commit is contained in:
parent
2a13cf7273
commit
b2b7e12aed
40
no-makeitem-method.patch
Normal file
40
no-makeitem-method.patch
Normal file
@ -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
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Mar 10 06:05:48 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Add patch no-makeitem-method.patch:
|
||||||
|
* Support pytest > 6.1
|
||||||
|
- No longer skip python310.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Dec 28 20:34:06 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
Tue Dec 28 20:34:06 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-pytest-relaxed
|
# 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
|
# 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
|
||||||
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
%define skip_python310 1
|
|
||||||
Name: python-pytest-relaxed
|
Name: python-pytest-relaxed
|
||||||
Version: 1.1.5
|
Version: 1.1.5
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -26,15 +25,16 @@ License: BSD-2-Clause
|
|||||||
URL: https://github.com/bitprophet/pytest-relaxed
|
URL: https://github.com/bitprophet/pytest-relaxed
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/pytest-relaxed/pytest-relaxed-%{version}.tar.gz
|
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
|
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}
|
BuildRequires: %{python_module decorator >= 4}
|
||||||
# gh#bitprophet/pytest-relaxed#12
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module pytest < 6.1}
|
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module six}
|
BuildRequires: %{python_module six}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-decorator >= 4
|
Requires: python-decorator >= 4
|
||||||
Requires: python-pytest < 6.1
|
Requires: python-pytest
|
||||||
Requires: python-six
|
Requires: python-six
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
@ -43,12 +43,11 @@ BuildArch: noarch
|
|||||||
Relaxed test discovery/organization plugin for pytest from python-paramiko author
|
Relaxed test discovery/organization plugin for pytest from python-paramiko author
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pytest-relaxed-%{version}
|
%autosetup -p1 -n pytest-relaxed-%{version}
|
||||||
# do not hardcode deps
|
# do not hardcode deps
|
||||||
sed -i setup.py \
|
sed -i setup.py \
|
||||||
-e 's:pytest>=3,<5:pytest>=3:' \
|
-e 's:pytest>=3,<5:pytest>=3:' \
|
||||||
-e 's:decorator>=4,<5:decorator>=4:'
|
-e 's:decorator>=4,<5:decorator>=4:'
|
||||||
%patch0 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export LANG=en_US.UTF-8
|
export LANG=en_US.UTF-8
|
||||||
|
Loading…
Reference in New Issue
Block a user