2017-10-18 10:50:34 +02:00
|
|
|
#
|
|
|
|
# spec file for package python-pytest-django
|
|
|
|
#
|
2023-06-25 21:19:11 +02:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2017-10-18 10:50:34 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-12-13 19:48:20 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-10-18 10:50:34 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2023-06-25 21:19:11 +02:00
|
|
|
%{?sle15_python_module_pythons}
|
2017-10-18 10:50:34 +02:00
|
|
|
Name: python-pytest-django
|
2021-12-27 17:49:28 +01:00
|
|
|
Version: 4.5.2
|
2017-10-18 10:50:34 +02:00
|
|
|
Release: 0
|
2022-03-29 21:46:20 +02:00
|
|
|
Summary: A Django plugin for Pytest
|
2017-10-18 10:50:34 +02:00
|
|
|
License: BSD-3-Clause
|
2018-12-13 19:48:20 +01:00
|
|
|
URL: https://github.com/pytest-dev/pytest-django
|
2017-10-18 10:50:34 +02:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pytest-django/pytest-django-%{version}.tar.gz
|
2022-02-22 22:28:13 +01:00
|
|
|
# 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
|
2022-03-29 21:46:20 +02:00
|
|
|
# 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
|
2018-12-13 19:48:20 +01:00
|
|
|
BuildRequires: %{python_module Django}
|
2020-10-29 10:41:58 +01:00
|
|
|
BuildRequires: %{python_module pytest > 5.4.0}
|
|
|
|
BuildRequires: %{python_module pytest-xdist}
|
2021-12-27 17:49:28 +01:00
|
|
|
BuildRequires: %{python_module setuptools_scm >= 5.0.0}
|
2017-10-18 10:50:34 +02:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-07-02 14:12:53 +02:00
|
|
|
BuildRequires: fdupes
|
2017-10-18 10:50:34 +02:00
|
|
|
BuildRequires: python-rpm-macros
|
2018-12-13 19:48:20 +01:00
|
|
|
BuildRequires: sqlite3
|
|
|
|
Requires: python-Django
|
2020-10-29 10:41:58 +01:00
|
|
|
Requires: python-pytest > 5.4.0
|
2017-10-18 10:50:34 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2017-10-20 14:47:07 +02:00
|
|
|
pytest-django allows testing Django projects/applications with the
|
|
|
|
pytest testing tool.
|
2017-10-18 10:50:34 +02:00
|
|
|
|
2017-10-20 14:47:07 +02:00
|
|
|
Running the test suite with pytest-django allows tapping into the features
|
|
|
|
that are already present in pytest:
|
2017-10-18 10:50:34 +02:00
|
|
|
|
|
|
|
* Manage test dependencies with pytest fixtures.
|
2017-10-20 14:47:07 +02:00
|
|
|
* Less boilerplate tests: no need to import unittest and creating a
|
|
|
|
subclass with methods. Tests can be written as regular functions.
|
2017-10-18 10:50:34 +02:00
|
|
|
* Database re-use: no need to re-create the test database for every test run.
|
|
|
|
* Run tests in multiple processes for increased speed (with the pytest-xdist plugin).
|
|
|
|
* Make use of other pytest plugins.
|
|
|
|
* Works with both worlds: Existing unittest-style TestCase's still work without any modifications.
|
|
|
|
|
|
|
|
%prep
|
2022-02-22 22:28:13 +01:00
|
|
|
%autosetup -p1 -n pytest-django-%{version}
|
2017-10-18 10:50:34 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
2018-12-13 19:48:20 +01:00
|
|
|
%check
|
2022-03-29 21:46:20 +02:00
|
|
|
# memory operations fail in OBS server-side, thus skip them
|
2018-12-13 19:48:20 +01:00
|
|
|
export DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite
|
2020-09-02 15:27:37 +02:00
|
|
|
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)'
|
2018-12-13 19:48:20 +01:00
|
|
|
|
2017-10-18 10:50:34 +02:00
|
|
|
%files %{python_files}
|
2018-12-13 19:48:20 +01:00
|
|
|
%license LICENSE
|
2019-02-25 09:51:23 +01:00
|
|
|
%doc AUTHORS README.rst docs/*.rst
|
2021-12-27 17:49:28 +01:00
|
|
|
%{python_sitelib}/pytest_django
|
|
|
|
%{python_sitelib}/pytest_django-%{version}*-info
|
2017-10-18 10:50:34 +02:00
|
|
|
|
|
|
|
%changelog
|