Accepting request 956875 from devel:languages:python:django
OBS-URL: https://build.opensuse.org/request/show/956875 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-django?expand=0&rev=16
This commit is contained in:
commit
8672402787
16
autoclear_mailbox.patch
Normal file
16
autoclear_mailbox.patch
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
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")
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 22 18:40:14 UTC 2022 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
- Add autoclear_mailbox.patch checking for the existence of the
|
||||
mail.outbox before clearing it (gh#pytest-dev/pytest-django#993).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 27 15:43:56 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-pytest-django
|
||||
#
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -26,6 +26,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
|
||||
# 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
|
||||
BuildRequires: %{python_module Django}
|
||||
BuildRequires: %{python_module pytest > 5.4.0}
|
||||
BuildRequires: %{python_module pytest-xdist}
|
||||
@ -56,7 +60,7 @@ that are already present in pytest:
|
||||
* Works with both worlds: Existing unittest-style TestCase's still work without any modifications.
|
||||
|
||||
%prep
|
||||
%setup -q -n pytest-django-%{version}
|
||||
%autosetup -p1 -n pytest-django-%{version}
|
||||
|
||||
%build
|
||||
%python_build
|
||||
|
Loading…
Reference in New Issue
Block a user