- Update to 3.1.0:

* Add plugins via entry points pytest_randomly.random_seeder to allow
    outside packages to register additional random generators to seed.
    This has added a dependency on the entrypoints package.
- Drop patch tests-restore-python2.7.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-randomly?expand=0&rev=10
This commit is contained in:
Tomáš Chvátal 2019-09-09 14:08:46 +00:00 committed by Git OBS Bridge
parent 0d86b652de
commit df55719333
5 changed files with 18 additions and 129 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:07b642e177c5921386fa36ee3995a4bda918a1d20b3806a4f397a02788f88331
size 9416

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5facc2b5ac56e36b9c4bf14f49cc7b4c95427835bbf4a3c739b71a5f5f82d58a
size 10264

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Sep 9 09:20:12 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 3.1.0:
* Add plugins via entry points pytest_randomly.random_seeder to allow
outside packages to register additional random generators to seed.
This has added a dependency on the entrypoints package.
- Drop patch tests-restore-python2.7.patch
-------------------------------------------------------------------
Mon Jun 3 09:13:50 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -16,26 +16,27 @@
#
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pytest-randomly
Version: 3.0.0
Version: 3.1.0
Release: 0
Summary: Pytest plugin to randomly order tests and control random.seed
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/adamchainz/pytest-randomly
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: fdupes
BuildRequires: python-rpm-macros
Requires: python-entrypoints
Requires: python-pytest
Recommends: python-Faker
Suggests: python-numpy
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module Faker}
BuildRequires: %{python_module entrypoints}
BuildRequires: %{python_module factory_boy}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module pytest}
@ -65,7 +66,6 @@ Features:
%prep
%setup -q -n pytest-randomly-%{version}
%patch0 -p1
# Disregard Python 3.4+ restriction
sed -i '/python_requires/d' setup.py
@ -78,7 +78,8 @@ sed -i '/python_requires/d' setup.py
%check
export PYTHONDONTWRITEBYTECODE=true
%pytest
# test_entrypoint_injection needs installed module for pytest to use
%pytest -k 'not test_entrypoint_injection'
%files %{python_files}
%doc AUTHORS.rst README.rst

View File

@ -1,121 +0,0 @@
--- 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)