From 9c3ae93e0831062623c35434b6e2eb60d28d155b Mon Sep 17 00:00:00 2001
From: StevenK <>
Date: May 14 2025 12:32:40 +0000
Subject: Update python-pytest-django to version 4.11.1 / rev 20 via SR 1276724


https://build.opensuse.org/request/show/1276724
by user StevenK + anag_factory
- Update to 4.11.1:
  * Compatibility
    + Added official support for Django 5.2.
    + Added official support for Python 3.13.
    + Added official support for Django 5.1.
    + Dropped support for Django 3.2 and 4.1.
    + Official Django 5.0 support.
    + Official Python 3.12 support.
    + Drop support for Python version 3.5, 3.6 & 3.7.
    + Drop official support for Django 4.0 and 2.2
    + Drop support for pytest < 7.
  * Improvements
    + Added using argument to django_assert_num_queries and
      django_assert_max_num_queries to easily specify the database alias to
      use.
    + Respect the string_if_invalid template setting when
      --fail-on-template-vars is active and
      pytest.mark.ignore_template_errors is used.
    + Avoid running database migrations for django.tes

---

diff --git a/.files b/.files
index c8a175f..ed79823 100644
Binary files a/.files and b/.files differ
diff --git a/.rev b/.rev
index b0af358..1738ae2 100644
--- a/.rev
+++ b/.rev
@@ -187,4 +187,41 @@ See request 531880 : https://build.opensuse.org/request/show/531880</comment>
 - Use sle15_python_module_pythons</comment>
     <requestid>1095248</requestid>
   </revision>
+  <revision rev="20" vrev="1">
+    <srcmd5>5bd0aecc4903bfe550365c1d7b89dca0</srcmd5>
+    <version>4.11.1</version>
+    <time>1747159927</time>
+    <user>anag_factory</user>
+    <comment>- Update to 4.11.1:
+  * Compatibility
+    + Added official support for Django 5.2.
+    + Added official support for Python 3.13.
+    + Added official support for Django 5.1.
+    + Dropped support for Django 3.2 and 4.1.
+    + Official Django 5.0 support.
+    + Official Python 3.12 support.
+    + Drop support for Python version 3.5, 3.6 &amp; 3.7.
+    + Drop official support for Django 4.0 and 2.2
+    + Drop support for pytest &lt; 7.
+  * Improvements
+    + Added using argument to django_assert_num_queries and
+      django_assert_max_num_queries to easily specify the database alias to
+      use.
+    + Respect the string_if_invalid template setting when
+      --fail-on-template-vars is active and
+      pytest.mark.ignore_template_errors is used.
+    + Avoid running database migrations for django.test.SimpleTestCase
+      unittest tests.
+    + Added pytest_django.asserts.assertMessages() to mimic the behaviour of
+      the django.contrib.messages.test.MessagesTestMixin.assertMessages method
+      for Django versions &gt;= 5.0.
+    + The Django test tags from the previous release now works on any
+      django.test.SimpleTestCase.
+    + Add support for setting available_apps in the pytest.mark.django_db
+      marker.
+    + Show Django's version in the pytest django report header.
+    + Add precise pytest_django.asserts.assertQuerySetEqual typing.
+  * Bugfixes</comment>
+    <requestid>1276724</requestid>
+  </revision>
 </revisionlist>
diff --git a/autoclear_mailbox.patch b/autoclear_mailbox.patch
deleted file mode 100644
index adc2529..0000000
--- a/autoclear_mailbox.patch
+++ /dev/null
@@ -1,16 +0,0 @@
----
- pytest_django/plugin.py |    3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
---- a/pytest_django/plugin.py
-+++ b/pytest_django/plugin.py
-@@ -502,7 +502,8 @@ def _dj_autoclear_mailbox() -> None:
- 
-     from django.core import mail
- 
--    del mail.outbox[:]
-+    if hasattr(mail, "outbox"):
-+        del mail.outbox[:]
- 
- 
- @pytest.fixture(scope="function")
diff --git a/pytest-django-4.5.2.tar.gz b/pytest-django-4.5.2.tar.gz
deleted file mode 120000
index 712cee8..0000000
--- a/pytest-django-4.5.2.tar.gz
+++ /dev/null
@@ -1 +0,0 @@
-/ipfs/bafkreigza5xxlg5xynuttw65lltggpay5x6csawru2p5x36sijvzodhgyi
\ No newline at end of file
diff --git a/pytest-django-pr996-pytest7.patch b/pytest-django-pr996-pytest7.patch
deleted file mode 100644
index 0bbd3ac..0000000
--- a/pytest-django-pr996-pytest7.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 458d48aee50171d3dec0ad6c9502bf7d795f9da1 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>
----
- tests/test_manage_py_scan.py | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/tests/test_manage_py_scan.py b/tests/test_manage_py_scan.py
-index 39544589..490882b0 100644
---- 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/pytest_django-4.11.1.tar.gz b/pytest_django-4.11.1.tar.gz
new file mode 120000
index 0000000..96b9090
--- /dev/null
+++ b/pytest_django-4.11.1.tar.gz
@@ -0,0 +1 @@
+/ipfs/bafkreifjjekbuhxbapfq46ra6fcr2nk7qp26jjoqppou3t65d7ip6itzse
\ No newline at end of file
diff --git a/python-pytest-django.changes b/python-pytest-django.changes
index 38f9109..8b057b0 100644
--- a/python-pytest-django.changes
+++ b/python-pytest-django.changes
@@ -1,4 +1,54 @@
 -------------------------------------------------------------------
+Mon May 12 06:48:41 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
+
+- Update to 4.11.1:
+  * Compatibility
+    + Added official support for Django 5.2.
+    + Added official support for Python 3.13.
+    + Added official support for Django 5.1.
+    + Dropped support for Django 3.2 and 4.1.
+    + Official Django 5.0 support.
+    + Official Python 3.12 support.
+    + Drop support for Python version 3.5, 3.6 & 3.7.
+    + Drop official support for Django 4.0 and 2.2
+    + Drop support for pytest < 7.
+  * Improvements
+    + Added using argument to django_assert_num_queries and
+      django_assert_max_num_queries to easily specify the database alias to
+      use.
+    + Respect the string_if_invalid template setting when
+      --fail-on-template-vars is active and
+      pytest.mark.ignore_template_errors is used.
+    + Avoid running database migrations for django.test.SimpleTestCase
+      unittest tests.
+    + Added pytest_django.asserts.assertMessages() to mimic the behaviour of
+      the django.contrib.messages.test.MessagesTestMixin.assertMessages method
+      for Django versions >= 5.0.
+    + The Django test tags from the previous release now works on any
+      django.test.SimpleTestCase.
+    + Add support for setting available_apps in the pytest.mark.django_db
+      marker.
+    + Show Django's version in the pytest django report header.
+    + Add precise pytest_django.asserts.assertQuerySetEqual typing.
+  * Bugfixes
+    + Fixed a regression in v4.11.0 for Django TestCase tests using the
+      databases class variable.
+    + Stopped setting up and serializing databases on test session setup when
+      not needed (the database is not requested / serialized_rollback is not
+      used).
+    + The determination of which databases to setup is done by static
+      inspection of the test suite.
+    + Fixed lock/unlock of db breaks if pytest is executed twice in the same
+      process.
+    + Fix --help/--version crash in a partially configured app.
+    + Fix bug where the effect of @pytest.mark.ignore_template_errors was not
+      reset when using --fail-on-template-vars.
+- Switch to pyproject macros.
+- Drop patches, included upstream:
+  * autoclear_mailbox.patch
+  * pytest-django-pr996-pytest7.patch
+
+-------------------------------------------------------------------
 Sun Jun 25 07:53:46 UTC 2023 - Andreas Schneider <asn@cryptomilk.org>
 
 - Use sle15_python_module_pythons
diff --git a/python-pytest-django.spec b/python-pytest-django.spec
index 55f9619..638c9c2 100644
--- a/python-pytest-django.spec
+++ b/python-pytest-django.spec
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pytest-django
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,28 +18,25 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-pytest-django
-Version:        4.5.2
+Version:        4.11.1
 Release:        0
 Summary:        A Django plugin for Pytest
 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
-# PATCH-FIX-UPSTREAM autoclear_mailbox.patch gh#pytest-dev/pytest-django#993 mcepl@suse.com
-# Protect against non-existant mail.outbox folder
-# https://stackoverflow.com/q/5424498/164233
-Patch0:         autoclear_mailbox.patch
-# PATCH-FIX-UPSTREAM pytest-django-pr996-pytest7.patch -- gh#pytest-dev/pytest-django#996
-Patch1:         https://github.com/pytest-dev/pytest-django/pull/996.patch#/pytest-django-pr996-pytest7.patch
+Source:         https://files.pythonhosted.org/packages/source/p/pytest-django/pytest_django-%{version}.tar.gz
 BuildRequires:  %{python_module Django}
-BuildRequires:  %{python_module pytest > 5.4.0}
+BuildRequires:  %{python_module base >= 3.8}
+BuildRequires:  %{python_module pip}
+BuildRequires:  %{python_module pytest >= 7.0}
 BuildRequires:  %{python_module pytest-xdist}
 BuildRequires:  %{python_module setuptools_scm >= 5.0.0}
 BuildRequires:  %{python_module setuptools}
+BuildRequires:  %{python_module wheel}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 BuildRequires:  sqlite3
 Requires:       python-Django
-Requires:       python-pytest > 5.4.0
+Requires:       python-pytest > 7.0
 BuildArch:      noarch
 %python_subpackages
 
@@ -59,13 +56,13 @@ that are already present in pytest:
 * Works with both worlds: Existing unittest-style TestCase's still work without any modifications.
 
 %prep
-%autosetup -p1 -n pytest-django-%{version}
+%autosetup -p1 -n pytest_django-%{version}
 
 %build
-%python_build
+%pyproject_wheel
 
 %install
-%python_install
+%pyproject_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
@@ -78,6 +75,6 @@ export PYTHONPATH=$(pwd)
 %license LICENSE
 %doc AUTHORS README.rst docs/*.rst
 %{python_sitelib}/pytest_django
-%{python_sitelib}/pytest_django-%{version}*-info
+%{python_sitelib}/pytest_django-%{version}.dist-info
 
 %changelog