1 |
commit: b4ca769092dd64a3eabacc092dcb4ebd66d677ff |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 30 11:16:36 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 30 11:30:13 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4ca7690 |
7 |
|
8 |
dev-python/pytest-django: fix tests with pytest 7; enable py3.11 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/834815 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
.../files/pytest-django-4.5.2-pytest-7.patch | 30 ++++++++++++++++++++++ |
14 |
.../pytest-django/pytest-django-4.5.2.ebuild | 6 ++++- |
15 |
2 files changed, 35 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/dev-python/pytest-django/files/pytest-django-4.5.2-pytest-7.patch b/dev-python/pytest-django/files/pytest-django-4.5.2-pytest-7.patch |
18 |
new file mode 100644 |
19 |
index 000000000000..657e5fa617a2 |
20 |
--- /dev/null |
21 |
+++ b/dev-python/pytest-django/files/pytest-django-4.5.2-pytest-7.patch |
22 |
@@ -0,0 +1,30 @@ |
23 |
+https://github.com/pytest-dev/pytest-django/commit/14b993d1cb291bfcf05f35f57db55c0419886534 |
24 |
+https://bugs.gentoo.org/834815 |
25 |
+ |
26 |
+From 14b993d1cb291bfcf05f35f57db55c0419886534 Mon Sep 17 00:00:00 2001 |
27 |
+From: Stanislav Levin <slev@××××××××.org> |
28 |
+Date: Mon, 28 Feb 2022 13:12:37 +0300 |
29 |
+Subject: [PATCH] tests: Sync expected stream for Pytest's version |
30 |
+ |
31 |
+https://docs.pytest.org/en/7.0.x/changelog.html#breaking-changes: |
32 |
+> [pytest#8246](https://github.com/pytest-dev/pytest/issues/8246): --version now writes version information to stdout rather than stderr. |
33 |
+ |
34 |
+Fixes: https://github.com/pytest-dev/pytest-django/issues/995 |
35 |
+Signed-off-by: Stanislav Levin <slev@××××××××.org> |
36 |
+--- a/tests/test_manage_py_scan.py |
37 |
++++ b/tests/test_manage_py_scan.py |
38 |
+@@ -118,7 +118,12 @@ def test_django_project_found_invalid_settings_version(django_testdir, monkeypat |
39 |
+ |
40 |
+ result = django_testdir.runpytest_subprocess("django_project_root", "--version", "--version") |
41 |
+ assert result.ret == 0 |
42 |
+- result.stderr.fnmatch_lines(["*This is pytest version*"]) |
43 |
++ if hasattr(pytest, "version_tuple") and pytest.version_tuple >= (7, 0): |
44 |
++ version_out = result.stdout |
45 |
++ else: |
46 |
++ version_out = result.stderr |
47 |
++ |
48 |
++ version_out.fnmatch_lines(["*This is pytest version*"]) |
49 |
+ |
50 |
+ result = django_testdir.runpytest_subprocess("django_project_root", "--help") |
51 |
+ assert result.ret == 0 |
52 |
+ |
53 |
|
54 |
diff --git a/dev-python/pytest-django/pytest-django-4.5.2.ebuild b/dev-python/pytest-django/pytest-django-4.5.2.ebuild |
55 |
index c8c2f52aae18..5ef63f301424 100644 |
56 |
--- a/dev-python/pytest-django/pytest-django-4.5.2.ebuild |
57 |
+++ b/dev-python/pytest-django/pytest-django-4.5.2.ebuild |
58 |
@@ -3,7 +3,7 @@ |
59 |
|
60 |
EAPI=8 |
61 |
|
62 |
-PYTHON_COMPAT=( python3_{8..10} ) |
63 |
+PYTHON_COMPAT=( python3_{8..11} ) |
64 |
inherit distutils-r1 |
65 |
|
66 |
DESCRIPTION="A Django plugin for py.test" |
67 |
@@ -30,6 +30,10 @@ BDEPEND=" |
68 |
) |
69 |
" |
70 |
|
71 |
+PATCHES=( |
72 |
+ "${FILESDIR}"/${P}-pytest-7.patch |
73 |
+) |
74 |
+ |
75 |
export SETUPTOOLS_SCM_PRETEND_VERSION=${PV} |
76 |
|
77 |
distutils_enable_tests --install pytest |