From 699f0e64851047c55d1d3fa7e2bd70fc92388d39 Mon Sep 17 00:00:00 2001 From: Merlin Mathesius Date: Thu, 20 Aug 2020 12:46:19 -0500 Subject: [PATCH] Fix Rawhide FTBFS error by pulling in upstream patch Fix ELN FTBFS error by making minor conditional fixes Signed-off-by: Merlin Mathesius --- ....1-Fix-deprecation-warnings-in-tests.patch | 39 +++++++++++++++++++ python-pytest-randomly.spec | 15 +++++-- 2 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 pytest-randomly-3.4.1-Fix-deprecation-warnings-in-tests.patch diff --git a/pytest-randomly-3.4.1-Fix-deprecation-warnings-in-tests.patch b/pytest-randomly-3.4.1-Fix-deprecation-warnings-in-tests.patch new file mode 100644 index 0000000..dae283c --- /dev/null +++ b/pytest-randomly-3.4.1-Fix-deprecation-warnings-in-tests.patch @@ -0,0 +1,39 @@ +Only in ./src: pytest_randomly.egg-info +diff -ru ../pytest-randomly-3.4.1.orig/tests/test_pytest_randomly.py ./tests/test_pytest_randomly.py +--- ../pytest-randomly-3.4.1.orig/tests/test_pytest_randomly.py 2020-08-20 11:54:50.721072606 -0500 ++++ ./tests/test_pytest_randomly.py 2020-08-20 12:02:17.275288884 -0500 +@@ -439,8 +439,8 @@ + + + class NoOpItem(pytest.Item): +- def __init__(self, path, parent, module=None): +- super(NoOpItem, self).__init__(path, parent) ++ def __init__(self, name, parent, module=None): ++ super(NoOpItem, self).__init__(name=name, parent=parent) + if module is not None: + self.module = module + +@@ -451,13 +451,19 @@ + def pytest_collect_file(path, parent): + if not str(path).endswith('.py'): + return +- return MyCollector( ++ return MyCollector.from_parent( ++ parent=parent, + fspath=str(path), + items=[ +- NoOpItem(str(path), parent, 'foo'), +- NoOpItem(str(path), parent), ++ NoOpItem.from_parent( ++ name=str(path) + "1", ++ parent=parent, module="foo" ++ ), ++ NoOpItem.from_parent( ++ name=str(path) + "2", ++ parent=parent, ++ ), + ], +- parent=parent, + ) + """ + ) diff --git a/python-pytest-randomly.spec b/python-pytest-randomly.spec index 9d27fb4..0871d97 100644 --- a/python-pytest-randomly.spec +++ b/python-pytest-randomly.spec @@ -3,7 +3,7 @@ Name: python-%{upstream_name} Version: 3.4.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Pytest plugin to randomly order tests and control random.seed License: BSD URL: https://github.com/pytest-dev/pytest-randomly @@ -12,6 +12,9 @@ Source0: https://files.pythonhosted.org/packages/source/p/%{upstream_name # not acceptable upstream: # https://github.com/pytest-dev/pytest-randomly/issues/218 Patch1: 0001-tests-fix-error-message-assertion-for-invalid-value.patch +# Cherry picked patch from upstream commit that fixes Rawhide FTBFS error +# https://github.com/pytest-dev/pytest-randomly/commit/c89ba6bb4458704f47e08d3f2fcc7cf0ebb8f9da +Patch2: pytest-randomly-3.4.1-Fix-deprecation-warnings-in-tests.patch BuildArch: noarch %description @@ -22,7 +25,7 @@ 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) +%if 0%{?fedora} < 32 && 0%{?rhel} < 9 BuildRequires: python3-importlib-metadata Requires: python3-importlib-metadata %endif @@ -30,7 +33,7 @@ Requires: python3-importlib-metadata BuildRequires: python3-pytest BuildRequires: python3-pytest-xdist BuildRequires: python3-factory-boy -%if 0%{?fedora} >= 33 +%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 BuildRequires: python3-faker %endif BuildRequires: python3-numpy @@ -49,7 +52,7 @@ rm -r src/*.egg-info %py3_install %check -%if 0%{?fedora} >= 33 +%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 PYTHONPATH=%{buildroot}%{python3_sitelib} PYTHONDONTWRITEBYTECODE=1 pytest-3 -p no:randomly -v tests/ %else # Faker pytest integration is only in Fedora 33+ @@ -65,6 +68,10 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} PYTHONDONTWRITEBYTECODE=1 pytest-3 -p %{python3_sitelib}/%{module_name}*.egg-info %changelog +* Thu Aug 20 2020 Merlin Mathesius - 3.4.1-4 +- Fix Rawhide FTBFS error by pulling in upstream patch +- Fix ELN FTBFS error by making minor conditional fixes + * Wed Jul 29 2020 Fedora Release Engineering - 3.4.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild