Accepting request 831464 from home:bnavigator:pytest6
- Fix test failure with pytest 6 * pytest-django-pytest6.patch * The patched call signature looks weird, but it works as intended * Patch is part of gh#pytest-dev/pytest-django#855 - Replace deprecated py.test call with %pytest macro OBS-URL: https://build.opensuse.org/request/show/831464 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-pytest-django?expand=0&rev=25
This commit is contained in:
parent
e019a9a285
commit
d6f003cfa6
22
pytest-django-pytest6.patch
Normal file
22
pytest-django-pytest6.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
From 3f03d0a7890e987086042b42db346e47398ffed3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Michael=20K=C3=A4ufl?= <pytest-django@c.michael-kaeufl.de>
|
||||||
|
Date: Sun, 2 Aug 2020 10:41:31 +0200
|
||||||
|
Subject: [PATCH] Fix compat with pytest 6
|
||||||
|
|
||||||
|
---
|
||||||
|
tests/test_manage_py_scan.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tests/test_manage_py_scan.py b/tests/test_manage_py_scan.py
|
||||||
|
index 8a0f9aad..a11f87c2 100644
|
||||||
|
--- a/tests/test_manage_py_scan.py
|
||||||
|
+++ b/tests/test_manage_py_scan.py
|
||||||
|
@@ -116,7 +116,7 @@ def test_django_project_found_invalid_settings_version(django_testdir, monkeypat
|
||||||
|
"""Invalid DSM should not cause an error with --help or --version."""
|
||||||
|
monkeypatch.setenv("DJANGO_SETTINGS_MODULE", "DOES_NOT_EXIST")
|
||||||
|
|
||||||
|
- result = django_testdir.runpytest_subprocess("django_project_root", "--version")
|
||||||
|
+ result = django_testdir.runpytest_subprocess("django_project_root", "--version", "--version")
|
||||||
|
assert result.ret == 0
|
||||||
|
result.stderr.fnmatch_lines(["*This is pytest version*"])
|
||||||
|
|
@ -1,3 +1,12 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 2 13:19:37 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
- Fix test failure with pytest 6
|
||||||
|
* pytest-django-pytest6.patch
|
||||||
|
* The patched call signature looks weird, but it works as intended
|
||||||
|
* Patch is part of gh#pytest-dev/pytest-django#855
|
||||||
|
- Replace deprecated py.test call with %pytest macro
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Aug 24 11:50:24 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
|
Mon Aug 24 11:50:24 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
|
||||||
|
|
||||||
|
@ -27,6 +27,8 @@ URL: https://github.com/pytest-dev/pytest-django
|
|||||||
Source: https://files.pythonhosted.org/packages/source/p/pytest-django/pytest-django-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/pytest-django/pytest-django-%{version}.tar.gz
|
||||||
# fix tests
|
# fix tests
|
||||||
Patch0: ignore-warnings.patch
|
Patch0: ignore-warnings.patch
|
||||||
|
# PATCH-FIX-UPSTREAM fix test failure with pytest 6, is part of https://github.com/pytest-dev/pytest-django/pull/855
|
||||||
|
Patch1: https://github.com/pytest-dev/pytest-django/commit/3f03d0a7890e987086042b42db346e47398ffed3.patch#/pytest-django-pytest6.patch
|
||||||
BuildRequires: %{python_module Django}
|
BuildRequires: %{python_module Django}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module setuptools_scm >= 1.11.1}
|
BuildRequires: %{python_module setuptools_scm >= 1.11.1}
|
||||||
@ -64,6 +66,7 @@ that are already present in pytest:
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n pytest-django-%{version}
|
%setup -q -n pytest-django-%{version}
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
|
%patch1 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
@ -75,7 +78,8 @@ that are already present in pytest:
|
|||||||
%check
|
%check
|
||||||
# memory operations failed in OBS not localy, thus skip them
|
# memory operations failed in OBS not localy, thus skip them
|
||||||
export DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite
|
export DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite
|
||||||
%python_expand PYTHONPATH=$(pwd) py.test-%{$python_bin_suffix} -v tests/ -k 'not (test_sqlite_in_memory_used or test_django_assert_num_queries_db or test_django_assert_max_num_queries_db)'
|
export PYTHONPATH=$(pwd)
|
||||||
|
%pytest -v tests/ -k 'not (test_sqlite_in_memory_used or test_django_assert_num_queries_db or test_django_assert_max_num_queries_db)'
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
Loading…
Reference in New Issue
Block a user