Accepting request 1086642 from devel:languages:python:pytest
Automatic submission by obs-autosubmit OBS-URL: https://build.opensuse.org/request/show/1086642 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-randomly?expand=0&rev=13
This commit is contained in:
commit
af5862787d
91
fix-tests-pytest-73.patch
Normal file
91
fix-tests-pytest-73.patch
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
From d663e203db254f7e310e4de0e4622e5596860698 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||||
|
Date: Wed, 12 Apr 2023 09:21:26 +0200
|
||||||
|
Subject: [PATCH] Make the tests work with pytest 7.3.0 (#540)
|
||||||
|
|
||||||
|
Co-authored-by: Adam Johnson <me@adamj.eu>
|
||||||
|
---
|
||||||
|
requirements/py310.txt | 10 +++-------
|
||||||
|
requirements/py311.txt | 10 +++-------
|
||||||
|
requirements/py37.txt | 10 +++-------
|
||||||
|
requirements/py38.txt | 10 +++-------
|
||||||
|
requirements/py39.txt | 10 +++-------
|
||||||
|
tests/test_pytest_randomly.py | 16 ++++++++--------
|
||||||
|
6 files changed, 23 insertions(+), 43 deletions(-)
|
||||||
|
|
||||||
|
Index: pytest-randomly-3.12.0/tests/test_pytest_randomly.py
|
||||||
|
===================================================================
|
||||||
|
--- pytest-randomly-3.12.0.orig/tests/test_pytest_randomly.py
|
||||||
|
+++ pytest-randomly-3.12.0/tests/test_pytest_randomly.py
|
||||||
|
@@ -253,7 +253,7 @@ def test_files_reordered(ourtestdir):
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
|
||||||
|
out.assert_outcomes(passed=4, failed=0)
|
||||||
|
- assert out.outlines[8:12] == [
|
||||||
|
+ assert out.outlines[9:13] == [
|
||||||
|
"test_b.py::test_it PASSED",
|
||||||
|
"test_a.py::test_it PASSED",
|
||||||
|
"test_d.py::test_it PASSED",
|
||||||
|
@@ -273,7 +273,7 @@ def test_files_reordered_when_seed_not_r
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
|
||||||
|
out.assert_outcomes(passed=4, failed=0)
|
||||||
|
- assert out.outlines[8:12] == [
|
||||||
|
+ assert out.outlines[9:13] == [
|
||||||
|
"test_b.py::test_it PASSED",
|
||||||
|
"test_a.py::test_it PASSED",
|
||||||
|
"test_d.py::test_it PASSED",
|
||||||
|
@@ -312,7 +312,7 @@ def test_classes_reordered(ourtestdir):
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
|
||||||
|
out.assert_outcomes(passed=4, failed=0)
|
||||||
|
- assert out.outlines[8:12] == [
|
||||||
|
+ assert out.outlines[9:13] == [
|
||||||
|
"test_one.py::D::test_d PASSED",
|
||||||
|
"test_one.py::B::test_b PASSED",
|
||||||
|
"test_one.py::C::test_c PASSED",
|
||||||
|
@@ -344,7 +344,7 @@ def test_class_test_methods_reordered(ou
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
|
||||||
|
out.assert_outcomes(passed=4, failed=0)
|
||||||
|
- assert out.outlines[8:12] == [
|
||||||
|
+ assert out.outlines[9:13] == [
|
||||||
|
"test_one.py::T::test_c PASSED",
|
||||||
|
"test_one.py::T::test_b PASSED",
|
||||||
|
"test_one.py::T::test_a PASSED",
|
||||||
|
@@ -373,7 +373,7 @@ def test_test_functions_reordered(ourtes
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
|
||||||
|
out.assert_outcomes(passed=4, failed=0)
|
||||||
|
- assert out.outlines[8:12] == [
|
||||||
|
+ assert out.outlines[9:13] == [
|
||||||
|
"test_one.py::test_c PASSED",
|
||||||
|
"test_one.py::test_a PASSED",
|
||||||
|
"test_one.py::test_b PASSED",
|
||||||
|
@@ -407,7 +407,7 @@ def test_test_functions_reordered_when_r
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
|
||||||
|
out.assert_outcomes(passed=4, failed=0)
|
||||||
|
- assert out.outlines[8:12] == [
|
||||||
|
+ assert out.outlines[9:13] == [
|
||||||
|
"test_one.py::test_c PASSED",
|
||||||
|
"test_one.py::test_a PASSED",
|
||||||
|
"test_one.py::test_b PASSED",
|
||||||
|
@@ -437,7 +437,7 @@ def test_doctests_reordered(ourtestdir):
|
||||||
|
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
out.assert_outcomes(passed=2)
|
||||||
|
- assert out.outlines[8:10] == [
|
||||||
|
+ assert out.outlines[9:11] == [
|
||||||
|
"test_one.py::test_one.bar PASSED",
|
||||||
|
"test_one.py::test_one.foo PASSED",
|
||||||
|
]
|
||||||
|
@@ -518,7 +518,7 @@ def test_doctests_in_txt_files_reordered
|
||||||
|
|
||||||
|
out = ourtestdir.runpytest(*args)
|
||||||
|
out.assert_outcomes(passed=2)
|
||||||
|
- assert out.outlines[8:10] == [
|
||||||
|
+ assert out.outlines[9:11] == [
|
||||||
|
"test2.txt::test2.txt PASSED",
|
||||||
|
"test.txt::test.txt PASSED",
|
||||||
|
]
|
3
pytest-randomly-3.12.0.tar.gz
Normal file
3
pytest-randomly-3.12.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:81348ae448f00df8f3b2768b90ff1bfe4b77a1ee20419a7621ae7c0826758617
|
||||||
|
size 30426
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:475cfbbfe6bbdc06f629f72b2d4a4f1ac6e9761f839be0fa1f50fde397434ebe
|
|
||||||
size 26200
|
|
@ -1,3 +1,23 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu May 4 22:57:32 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- update to 3.12.0:
|
||||||
|
* Support Python 3.11.
|
||||||
|
* Drop Python 3.6 support.
|
||||||
|
* Work on FIPS Python 3.9+, by declaring use of
|
||||||
|
``hashlib.md5()`` as not used for security.
|
||||||
|
* Fix crash when pytest’s cacheprovider is disabled.
|
||||||
|
* Improve group name in ``pytest --help``.
|
||||||
|
* Fix new shuffling to work when one or more test in a class or
|
||||||
|
module have the same test id.
|
||||||
|
* Rework shuffling algorithm to use hashing. This means that
|
||||||
|
running a subset of tests with the same seed will now produce
|
||||||
|
the same ordering as running the full set of tests.
|
||||||
|
This allows narrowing down ordering-related failures.
|
||||||
|
* Add type hints.
|
||||||
|
* Support Python 3.10.
|
||||||
|
- add fix-tests-pytest-73.patch to support pytest 7.3.x
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Apr 21 12:31:53 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
Fri Apr 21 12:31:53 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-pytest-randomly
|
# spec file for package python-pytest-randomly
|
||||||
#
|
#
|
||||||
# Copyright (c) 2021 SUSE LLC
|
# Copyright (c) 2023 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
|
||||||
@ -16,25 +16,26 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python3-%{**}}
|
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-pytest-randomly
|
Name: python-pytest-randomly
|
||||||
Version: 3.7.0
|
Version: 3.12.0
|
||||||
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: MIT
|
License: MIT
|
||||||
URL: https://github.com/pytest-dev/pytest-randomly
|
URL: https://github.com/pytest-dev/pytest-randomly
|
||||||
Source: https://github.com/pytest-dev/pytest-randomly/archive/%{version}.tar.gz#/pytest-randomly-%{version}.tar.gz
|
Source: https://github.com/pytest-dev/pytest-randomly/archive/%{version}.tar.gz#/pytest-randomly-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM: https://github.com/pytest-dev/pytest-randomly/commit/d663e203db254f7e310e4de0e4622e5596860698.patch
|
||||||
|
Patch1: fix-tests-pytest-73.patch
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-importlib-metadata >= 3.6.0
|
Requires: python-importlib-metadata >= 3.6.0
|
||||||
Requires: python-pytest
|
Requires: python-pytest
|
||||||
Recommends: python-Faker >= 4.1.0
|
Recommends: python-Faker >= 13.11.0
|
||||||
Suggests: python-numpy
|
Suggests: python-numpy
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
BuildRequires: %{python_module Faker >= 4.1.0}
|
BuildRequires: %{python_module Faker >= 13.11.0}
|
||||||
BuildRequires: %{python_module factory_boy}
|
BuildRequires: %{python_module factory_boy}
|
||||||
BuildRequires: %{python_module importlib-metadata >= 3.6.0}
|
BuildRequires: %{python_module importlib-metadata >= 3.6.0}
|
||||||
BuildRequires: %{python_module pytest-xdist}
|
BuildRequires: %{python_module pytest-xdist}
|
||||||
@ -64,7 +65,7 @@ Features:
|
|||||||
every test.
|
every test.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pytest-randomly-%{version}
|
%autosetup -p1 -n pytest-randomly-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
@ -75,16 +76,12 @@ Features:
|
|||||||
|
|
||||||
%check
|
%check
|
||||||
# test_entrypoint_injection needs installed module for pytest to use
|
# test_entrypoint_injection needs installed module for pytest to use
|
||||||
donttest="test_entrypoint_injection"
|
%pytest -k "not (test_entrypoint_injection or test_it_runs_before_stepwise)"
|
||||||
# no python36-numpy
|
|
||||||
python36_donttest="or test_numpy"
|
|
||||||
%pytest -k "not ($donttest ${$python_donttest})"
|
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python_sitelib}/pytest_randomly.py*
|
%{python_sitelib}/pytest_randomly
|
||||||
%pycache_only %{python_sitelib}/__pycache__/pytest_randomly*.pyc
|
|
||||||
%{python_sitelib}/pytest_randomly-%{version}*-info
|
%{python_sitelib}/pytest_randomly-%{version}*-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user