Accepting request 689139 from devel:languages:python:pytest
OBS-URL: https://build.opensuse.org/request/show/689139 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-randomly?expand=0&rev=3
This commit is contained in:
commit
2ba4cc4def
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:92ec6745d3ebdd690ecb598648748c9601f16f5afacf83ccef2b50d23e6edb7f
|
|
||||||
size 8297
|
|
3
pytest-randomly-2.1.1.tar.gz
Normal file
3
pytest-randomly-2.1.1.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:0ff564fabb638ab52d535d8ce1da71353c7ecd54edcc5dc117f6f21f8269cfef
|
||||||
|
size 9064
|
@ -1,3 +1,19 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Mar 26 10:08:08 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||||||
|
|
||||||
|
- Downgrade Faker dependency to Recommends
|
||||||
|
- Add Suggests for numpy
|
||||||
|
- Add tests-restore-python2.7.patch to re-add support for Python 2.7
|
||||||
|
- Use PYTHONDONTWRITEBYTECODE=true to fix file-contains-buildroot
|
||||||
|
on Leap 42.3
|
||||||
|
- Update to v2.1.1
|
||||||
|
* Fix including tests in sdist after re-arrangement in 2.1.0
|
||||||
|
- from v2.1.0
|
||||||
|
* Add the option --randomly-seed=last to reuse the last used value
|
||||||
|
for the seed
|
||||||
|
- from v2.0.0
|
||||||
|
* Drop Python 2 support, only Python 3.4+ is supported now
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Feb 14 15:24:04 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
Thu Feb 14 15:24:04 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
|
||||||
@ -6,4 +22,4 @@ Thu Feb 14 15:24:04 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
|||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jan 21 03:52:33 UTC 2019 - Todd R <toddrme2178@gmail.com>
|
Mon Jan 21 03:52:33 UTC 2019 - Todd R <toddrme2178@gmail.com>
|
||||||
|
|
||||||
- Initial version
|
- Initial version for v1.2.3
|
||||||
|
@ -18,24 +18,28 @@
|
|||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
Name: python-pytest-randomly
|
Name: python-pytest-randomly
|
||||||
Version: 1.2.3
|
Version: 2.1.1
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Pytest plugin to randomly order tests and control random.seed
|
Summary: Pytest plugin to randomly order tests and control random.seed
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://github.com/adamchainz/pytest-randomly
|
URL: https://github.com/adamchainz/pytest-randomly
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/pytest-randomly/pytest-randomly-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/pytest-randomly/pytest-randomly-%{version}.tar.gz
|
||||||
|
# Reverse of https://github.com/pytest-dev/pytest-randomly/commit/7ca48ad.patch
|
||||||
|
Patch0: tests-restore-python2.7.patch
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-Faker
|
|
||||||
Requires: python-pytest
|
Requires: python-pytest
|
||||||
|
Recommends: python-Faker
|
||||||
|
Suggests: python-numpy
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
BuildRequires: %{python_module Faker}
|
BuildRequires: %{python_module Faker}
|
||||||
BuildRequires: %{python_module factory_boy}
|
BuildRequires: %{python_module factory_boy}
|
||||||
BuildRequires: %{python_module numpy}
|
BuildRequires: %{python_module numpy}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
|
BuildRequires: %{python_module six}
|
||||||
# /SECTION
|
# /SECTION
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
@ -61,6 +65,9 @@ Features:
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pytest-randomly-%{version}
|
%setup -q -n pytest-randomly-%{version}
|
||||||
|
%patch0 -p1
|
||||||
|
# Disregard Python 3.4+ restriction
|
||||||
|
sed -i '/python_requires/d' setup.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
@ -70,6 +77,7 @@ Features:
|
|||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
export PYTHONDONTWRITEBYTECODE=true
|
||||||
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} -v
|
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} -v
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
|
121
tests-restore-python2.7.patch
Normal file
121
tests-restore-python2.7.patch
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
--- a/test_pytest_randomly.py
|
||||||
|
+++ b/test_pytest_randomly.py
|
||||||
|
@@ -1,6 +1,13 @@
|
||||||
|
+# -*- encoding:utf-8 -*-
|
||||||
|
+from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
+
|
||||||
|
import pytest
|
||||||
|
+import six
|
||||||
|
|
||||||
|
-pytest_plugins = ['pytester']
|
||||||
|
+if six.PY3:
|
||||||
|
+ pytest_plugins = ['pytester']
|
||||||
|
+else:
|
||||||
|
+ pytest_plugins = [b'pytester']
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
@@ -221,7 +228,11 @@
|
||||||
|
test_c=code,
|
||||||
|
test_d=code,
|
||||||
|
)
|
||||||
|
- args = ['-v', '--randomly-seed=15']
|
||||||
|
+ args = ['-v']
|
||||||
|
+ if six.PY3: # Python 3 random changes
|
||||||
|
+ args.append('--randomly-seed=15')
|
||||||
|
+ else:
|
||||||
|
+ args.append('--randomly-seed=41')
|
||||||
|
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
|
||||||
|
@@ -245,7 +256,11 @@
|
||||||
|
test_c=code,
|
||||||
|
test_d=code,
|
||||||
|
)
|
||||||
|
- args = ['-v', '--randomly-seed=15']
|
||||||
|
+ args = ['-v']
|
||||||
|
+ if six.PY3: # Python 3 random changes
|
||||||
|
+ args.append('--randomly-seed=15')
|
||||||
|
+ else:
|
||||||
|
+ args.append('--randomly-seed=41')
|
||||||
|
|
||||||
|
args.append('--randomly-dont-reset-seed')
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
@@ -285,7 +300,11 @@
|
||||||
|
pass
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
- args = ['-v', '--randomly-seed=15']
|
||||||
|
+ args = ['-v']
|
||||||
|
+ if six.PY3: # Python 3 random changes
|
||||||
|
+ args.append('--randomly-seed=15')
|
||||||
|
+ else:
|
||||||
|
+ args.append('--randomly-seed=41')
|
||||||
|
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
|
||||||
|
@@ -317,7 +336,11 @@
|
||||||
|
pass
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
- args = ['-v', '--randomly-seed=15']
|
||||||
|
+ args = ['-v']
|
||||||
|
+ if six.PY3: # Python 3 random changes
|
||||||
|
+ args.append('--randomly-seed=15')
|
||||||
|
+ else:
|
||||||
|
+ args.append('--randomly-seed=41')
|
||||||
|
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
|
||||||
|
@@ -346,7 +369,11 @@
|
||||||
|
pass
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
- args = ['-v', '--randomly-seed=15']
|
||||||
|
+ args = ['-v']
|
||||||
|
+ if six.PY3: # Python 3 random changes
|
||||||
|
+ args.append('--randomly-seed=15')
|
||||||
|
+ else:
|
||||||
|
+ args.append('--randomly-seed=41')
|
||||||
|
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
|
||||||
|
@@ -380,7 +407,11 @@
|
||||||
|
pass
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
- args = ['-v', '--randomly-seed=15']
|
||||||
|
+ args = ['-v']
|
||||||
|
+ if six.PY3: # Python 3 random changes
|
||||||
|
+ args.append('--randomly-seed=15')
|
||||||
|
+ else:
|
||||||
|
+ args.append('--randomly-seed=41')
|
||||||
|
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
|
||||||
|
@@ -411,7 +442,11 @@
|
||||||
|
return 9002
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
- args = ['-v', '--doctest-modules', '--randomly-seed=5']
|
||||||
|
+ args = ['-v', '--doctest-modules']
|
||||||
|
+ if six.PY3: # Python 3 random changes
|
||||||
|
+ args.append('--randomly-seed=5')
|
||||||
|
+ else:
|
||||||
|
+ args.append('--randomly-seed=2')
|
||||||
|
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
out.assert_outcomes(passed=2)
|
||||||
|
@@ -474,7 +509,11 @@
|
||||||
|
>>> 2 - 2
|
||||||
|
0
|
||||||
|
''')
|
||||||
|
- args = ['-v', '--randomly-seed=1']
|
||||||
|
+ args = ['-v']
|
||||||
|
+ if six.PY3: # Python 3 random changes
|
||||||
|
+ args.append('--randomly-seed=1')
|
||||||
|
+ else:
|
||||||
|
+ args.append('--randomly-seed=4')
|
||||||
|
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
out.assert_outcomes(passed=2)
|
Loading…
x
Reference in New Issue
Block a user