* 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
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-pytest-django?expand=0&rev=37
81 lines
2.9 KiB
RPMSpec
81 lines
2.9 KiB
RPMSpec
#
|
|
# spec file for package python-pytest-django
|
|
#
|
|
# 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
|
|
# 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.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%{?sle15_python_module_pythons}
|
|
Name: python-pytest-django
|
|
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
|
|
BuildRequires: %{python_module Django}
|
|
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 > 7.0
|
|
BuildArch: noarch
|
|
%python_subpackages
|
|
|
|
%description
|
|
pytest-django allows testing Django projects/applications with the
|
|
pytest testing tool.
|
|
|
|
Running the test suite with pytest-django allows tapping into the features
|
|
that are already present in pytest:
|
|
|
|
* Manage test dependencies with pytest fixtures.
|
|
* Less boilerplate tests: no need to import unittest and creating a
|
|
subclass with methods. Tests can be written as regular functions.
|
|
* 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
|
|
%autosetup -p1 -n pytest_django-%{version}
|
|
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
%install
|
|
%pyproject_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
%check
|
|
# memory operations fail in OBS server-side, thus skip them
|
|
export DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite
|
|
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)'
|
|
|
|
%files %{python_files}
|
|
%license LICENSE
|
|
%doc AUTHORS README.rst docs/*.rst
|
|
%{python_sitelib}/pytest_django
|
|
%{python_sitelib}/pytest_django-%{version}.dist-info
|
|
|
|
%changelog
|