public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pytest-django/, dev-python/pytest-django/files/
@ 2022-10-30 11:32 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2022-10-30 11:32 UTC (permalink / raw
  To: gentoo-commits

commit:     b4ca769092dd64a3eabacc092dcb4ebd66d677ff
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 30 11:16:36 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 30 11:30:13 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4ca7690

dev-python/pytest-django: fix tests with pytest 7; enable py3.11

Closes: https://bugs.gentoo.org/834815
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/pytest-django-4.5.2-pytest-7.patch       | 30 ++++++++++++++++++++++
 .../pytest-django/pytest-django-4.5.2.ebuild       |  6 ++++-
 2 files changed, 35 insertions(+), 1 deletion(-)

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
new file mode 100644
index 000000000000..657e5fa617a2
--- /dev/null
+++ b/dev-python/pytest-django/files/pytest-django-4.5.2-pytest-7.patch
@@ -0,0 +1,30 @@
+https://github.com/pytest-dev/pytest-django/commit/14b993d1cb291bfcf05f35f57db55c0419886534
+https://bugs.gentoo.org/834815
+
+From 14b993d1cb291bfcf05f35f57db55c0419886534 Mon Sep 17 00:00:00 2001
+From: Stanislav Levin <slev@altlinux.org>
+Date: Mon, 28 Feb 2022 13:12:37 +0300
+Subject: [PATCH] tests: Sync expected stream for Pytest's version
+
+https://docs.pytest.org/en/7.0.x/changelog.html#breaking-changes:
+> [pytest#8246](https://github.com/pytest-dev/pytest/issues/8246): --version now writes version information to stdout rather than stderr.
+
+Fixes: https://github.com/pytest-dev/pytest-django/issues/995
+Signed-off-by: Stanislav Levin <slev@altlinux.org>
+--- a/tests/test_manage_py_scan.py
++++ b/tests/test_manage_py_scan.py
+@@ -118,7 +118,12 @@ def test_django_project_found_invalid_settings_version(django_testdir, monkeypat
+ 
+     result = django_testdir.runpytest_subprocess("django_project_root", "--version", "--version")
+     assert result.ret == 0
+-    result.stderr.fnmatch_lines(["*This is pytest version*"])
++    if hasattr(pytest, "version_tuple") and pytest.version_tuple >= (7, 0):
++        version_out = result.stdout
++    else:
++        version_out = result.stderr
++
++    version_out.fnmatch_lines(["*This is pytest version*"])
+ 
+     result = django_testdir.runpytest_subprocess("django_project_root", "--help")
+     assert result.ret == 0
+

diff --git a/dev-python/pytest-django/pytest-django-4.5.2.ebuild b/dev-python/pytest-django/pytest-django-4.5.2.ebuild
index c8c2f52aae18..5ef63f301424 100644
--- a/dev-python/pytest-django/pytest-django-4.5.2.ebuild
+++ b/dev-python/pytest-django/pytest-django-4.5.2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_COMPAT=( python3_{8..11} )
 inherit distutils-r1
 
 DESCRIPTION="A Django plugin for py.test"
@@ -30,6 +30,10 @@ BDEPEND="
 	)
 "
 
+PATCHES=(
+	"${FILESDIR}"/${P}-pytest-7.patch
+)
+
 export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
 
 distutils_enable_tests --install pytest


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-30 11:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-30 11:32 [gentoo-commits] repo/gentoo:master commit in: dev-python/pytest-django/, dev-python/pytest-django/files/ Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox