Accepting request 831465 from devel:languages:python:django
OBS-URL: https://build.opensuse.org/request/show/831465 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-django?expand=0&rev=13
This commit is contained in:
commit
f397fca802
13
ignore-warnings.patch
Normal file
13
ignore-warnings.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: pytest-django-3.9.0/tests/test_fixtures.py
|
||||
===================================================================
|
||||
--- pytest-django-3.9.0.orig/tests/test_fixtures.py
|
||||
+++ pytest-django-3.9.0/tests/test_fixtures.py
|
||||
@@ -597,7 +597,7 @@ class Migration(migrations.Migration):
|
||||
)
|
||||
|
||||
result = django_testdir.runpytest_subprocess("-s")
|
||||
- result.stdout.fnmatch_lines(["* 1 passed in*"])
|
||||
+ result.stdout.fnmatch_lines(["* 1 passed*"])
|
||||
assert result.ret == 0
|
||||
|
||||
|
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,17 @@
|
||||
-------------------------------------------------------------------
|
||||
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>
|
||||
|
||||
- Fix build with ignore-warnings.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 3 10:20:28 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
|
@ -25,6 +25,10 @@ Summary: A Django plugin for py.test
|
||||
License: BSD-3-Clause
|
||||
URL: https://github.com/pytest-dev/pytest-django
|
||||
Source: https://files.pythonhosted.org/packages/source/p/pytest-django/pytest-django-%{version}.tar.gz
|
||||
# fix tests
|
||||
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 pytest}
|
||||
BuildRequires: %{python_module setuptools_scm >= 1.11.1}
|
||||
@ -61,6 +65,8 @@ that are already present in pytest:
|
||||
|
||||
%prep
|
||||
%setup -q -n pytest-django-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
|
||||
%build
|
||||
%python_build
|
||||
@ -72,7 +78,8 @@ that are already present in pytest:
|
||||
%check
|
||||
# memory operations failed in OBS not localy, thus skip them
|
||||
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}
|
||||
%license LICENSE
|
||||
|
Loading…
x
Reference in New Issue
Block a user