Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc5f60c441 |
2 changed files with 61 additions and 2 deletions
55
0001-use-pytest.param-in-parametrize-decorator.patch
Normal file
55
0001-use-pytest.param-in-parametrize-decorator.patch
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
From ea99dae0b4b0cfcd232498e8af832874fdaeb983 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Fabien Boucher <fboucher@redhat.com>
|
||||||
|
Date: Tue, 16 Jun 2020 13:47:17 +0200
|
||||||
|
Subject: [PATCH] use pytest.param in parametrize decorator
|
||||||
|
|
||||||
|
---
|
||||||
|
tests/test_util.py | 31 ++++++++++++++++++-------------
|
||||||
|
1 file changed, 18 insertions(+), 13 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/test_util.py b/tests/test_util.py
|
||||||
|
index 973b81a..81d37c2 100644
|
||||||
|
--- a/tests/test_util.py
|
||||||
|
+++ b/tests/test_util.py
|
||||||
|
@@ -215,20 +215,25 @@ class TestObjToRef(object):
|
||||||
|
assert str(exc.value) == 'Cannot create a reference to a nested function'
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('input,expected', [
|
||||||
|
- pytest.mark.skipif(sys.version_info[:2] == (3, 2),
|
||||||
|
- reason="Unbound methods can't be resolved on Python 3.2")(
|
||||||
|
- (DummyClass.meth, 'tests.test_util:DummyClass.meth')
|
||||||
|
- ),
|
||||||
|
+ pytest.param(
|
||||||
|
+ DummyClass.meth,
|
||||||
|
+ 'tests.test_util:DummyClass.meth',
|
||||||
|
+ marks=pytest.mark.skipif(
|
||||||
|
+ sys.version_info[:2] == (3, 2),
|
||||||
|
+ reason="Unbound methods can't be resolved on Python 3.2")),
|
||||||
|
(DummyClass.classmeth, 'tests.test_util:DummyClass.classmeth'),
|
||||||
|
- pytest.mark.skipif(sys.version_info < (3, 3),
|
||||||
|
- reason="Requires __qualname__ (Python 3.3+)")(
|
||||||
|
- (DummyClass.InnerDummyClass.innerclassmeth,
|
||||||
|
- 'tests.test_util:DummyClass.InnerDummyClass.innerclassmeth')
|
||||||
|
- ),
|
||||||
|
- pytest.mark.skipif(sys.version_info < (3, 3),
|
||||||
|
- reason="Requires __qualname__ (Python 3.3+)")(
|
||||||
|
- (DummyClass.staticmeth, 'tests.test_util:DummyClass.staticmeth')
|
||||||
|
- ),
|
||||||
|
+ pytest.param(
|
||||||
|
+ DummyClass.InnerDummyClass.innerclassmeth,
|
||||||
|
+ 'tests.test_util:DummyClass.InnerDummyClass.innerclassmeth',
|
||||||
|
+ marks=pytest.mark.skipif(
|
||||||
|
+ sys.version_info < (3, 3),
|
||||||
|
+ reason="Requires __qualname__ (Python 3.3+)")),
|
||||||
|
+ pytest.param(
|
||||||
|
+ DummyClass.staticmeth,
|
||||||
|
+ 'tests.test_util:DummyClass.staticmeth',
|
||||||
|
+ marks=pytest.mark.skipif(
|
||||||
|
+ sys.version_info < (3, 3),
|
||||||
|
+ reason="Requires __qualname__ (Python 3.3+)")),
|
||||||
|
(timedelta, 'datetime:timedelta'),
|
||||||
|
], ids=['unbound method', 'class method', 'inner class method', 'static method', 'timedelta'])
|
||||||
|
def test_valid_refs(self, input, expected):
|
||||||
|
--
|
||||||
|
2.25.4
|
||||||
|
|
||||||
|
|
@ -2,12 +2,13 @@
|
||||||
|
|
||||||
Name: python-%{pypi_name}
|
Name: python-%{pypi_name}
|
||||||
Version: 3.5.3
|
Version: 3.5.3
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: In-process task scheduler with Cron-like capabilities
|
Summary: In-process task scheduler with Cron-like capabilities
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://pypi.python.org/pypi/%{pypi_name}
|
URL: https://pypi.python.org/pypi/%{pypi_name}
|
||||||
Source0: https://pypi.python.org/packages/source/A/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
Source0: https://pypi.python.org/packages/source/A/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
||||||
|
Patch0: 0001-use-pytest.param-in-parametrize-decorator.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
|
|
@ -48,7 +49,7 @@ BuildRequires: python3-sphinx
|
||||||
Documentation of the Advanced Python Scheduler library.
|
Documentation of the Advanced Python Scheduler library.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{pypi_name}-%{version}
|
%autosetup -p1 -n %{pypi_name}-%{version}
|
||||||
rm -rf %{pypi_name}.egg-info
|
rm -rf %{pypi_name}.egg-info
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
@ -79,6 +80,9 @@ export TZ=UTC
|
||||||
%doc docs/_build/html
|
%doc docs/_build/html
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jun 16 2020 Fabien Boucher <fboucher@redhat.com> - 3.5.3-4
|
||||||
|
- Patch to fix #1714212 due to marks in pytest.mark.parametrize deprecated
|
||||||
|
|
||||||
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.3-3
|
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.3-3
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue