From c8bf34d708618785efd87bf87a26c8088541ff37 Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Thu, 30 Jan 2020 18:12:56 +1000 Subject: [PATCH] new upstream release 3.2.1 --- .gitignore | 1 + ...-message-assertion-for-invalid-value.patch | 32 +++++++++++++++++++ python-pytest-randomly.spec | 21 +++++++++--- sources | 2 +- 4 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 0001-tests-fix-error-message-assertion-for-invalid-value.patch diff --git a/.gitignore b/.gitignore index 104cff2..ba687cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /pytest-randomly-1.2.3.tar.gz +/pytest-randomly-3.2.1.tar.gz diff --git a/0001-tests-fix-error-message-assertion-for-invalid-value.patch b/0001-tests-fix-error-message-assertion-for-invalid-value.patch new file mode 100644 index 0000000..82ce89f --- /dev/null +++ b/0001-tests-fix-error-message-assertion-for-invalid-value.patch @@ -0,0 +1,32 @@ +From 9e1d313fecc87662245607b4682835eb9a87cdac Mon Sep 17 00:00:00 2001 +From: Dan Callaghan +Date: Thu, 30 Jan 2020 18:09:18 +1000 +Subject: [PATCH] tests: fix error message assertion for invalid value + +This was failing in Fedora because the message we see is worded +differently to what the upstream test suite is expecting. + + E Failed: nomatch: "pytest: error: argument --randomly-seed: 'invalidvalue' is not an integer or the string 'last'" + E and: 'usage: pytest.py [options] [file_or_dir] [file_or_dir] [...]' + E and: "pytest.py: error: argument --randomly-seed: invalid int value: 'invalidvalue'" + E remains unmatched: "pytest: error: argument --randomly-seed: 'invalidvalue' is not an integer or the string 'last'" + +See also: +https://github.com/pytest-dev/pytest-randomly/issues/218#issuecomment-560501423 + +diff --git a/tests/test_pytest_randomly.py b/tests/test_pytest_randomly.py +index f81284d..13e15b1 100644 +--- a/tests/test_pytest_randomly.py ++++ b/tests/test_pytest_randomly.py +@@ -121,7 +121,7 @@ def test_passing_nonsense_for_randomly_seed(ourtestdir): + out.stderr.fnmatch_lines( + [ + ( +- "pytest: error: argument --randomly-seed: 'invalidvalue' " ++ "*: error: argument --randomly-seed: 'invalidvalue' " + + "is not an integer or the string 'last'" + ) + ] +-- +2.21.1 + diff --git a/python-pytest-randomly.spec b/python-pytest-randomly.spec index a98944c..ab0221f 100644 --- a/python-pytest-randomly.spec +++ b/python-pytest-randomly.spec @@ -2,12 +2,16 @@ %global module_name pytest_randomly Name: python-%{upstream_name} -Version: 1.2.3 -Release: 2%{?dist} +Version: 3.2.1 +Release: 1%{?dist} Summary: Pytest plugin to randomly order tests and control random.seed License: BSD URL: https://github.com/pytest-dev/pytest-randomly Source0: https://files.pythonhosted.org/packages/source/p/%{upstream_name}/%{upstream_name}-%{version}.tar.gz +# Fedora-specific test fix to account for our version of pytest, +# not acceptable upstream: +# https://github.com/pytest-dev/pytest-randomly/issues/218 +Patch1: 0001-tests-fix-error-message-assertion-for-invalid-value.patch BuildArch: noarch %description @@ -18,6 +22,10 @@ Summary: Pytest plugin to randomly order tests and control random.seed %{?python_provide:%python_provide python3-%{upstream_name}} BuildRequires: python3-devel BuildRequires: python3-setuptools +%if ! (0%{?fedora} >= 32) +BuildRequires: python3-importlib-metadata +Requires: python3-importlib-metadata +%endif # Only for running the tests: BuildRequires: python3-pytest BuildRequires: python3-factory-boy @@ -27,8 +35,8 @@ BuildRequires: python3-numpy %{summary}. %prep -%setup -q -n %{upstream_name}-%{version} -rm -r *.egg-info +%autosetup -n %{upstream_name}-%{version} -p1 +rm -r src/*.egg-info %build %py3_build @@ -37,7 +45,7 @@ rm -r *.egg-info %py3_install %check -PYTHONPATH=%{buildroot}%{python3_sitelib} PYTHONDONTWRITEBYTECODE=1 pytest-3 -v tests/ +PYTHONPATH=%{buildroot}%{python3_sitelib} PYTHONDONTWRITEBYTECODE=1 pytest-3 -p no:randomly -v tests/ %files -n python3-%{upstream_name} %doc README.rst HISTORY.rst AUTHORS.rst @@ -47,6 +55,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} PYTHONDONTWRITEBYTECODE=1 pytest-3 -v %{python3_sitelib}/%{module_name}*.egg-info %changelog +* Thu Jan 30 2020 Dan Callaghan - 3.2.1-1 +- new upstream release 3.2.1 + * Mon Dec 30 2019 Dan Callaghan - 1.2.3-2 - re-enabled tests, suppress pytest bytecode diff --git a/sources b/sources index feaed6b..ae89113 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a14d9ac82ac744e7c3ddf51e62d5c751 pytest-randomly-1.2.3.tar.gz +SHA512 (pytest-randomly-3.2.1.tar.gz) = 1ea0dd7d43e2193d90aa5ea8caeaf3933c00b3d57e7917702902eeb010170034f949fdc02c3d2c7920b64d2e20a39d96e581b8d17a7aaa2768432efbd0155057