django-json-api / django-rest-framework-json-api

JSON:API support for Django REST framework
https://django-rest-framework-json-api.readthedocs.org/
BSD 2-Clause "Simplified" License
1.18k stars 294 forks source link

Scheduled biweekly dependency update for week 09 #1203

Closed pyup-bot closed 6 months ago

pyup-bot commented 6 months ago

Update black from 23.12.1 to 24.2.0.

Changelog ### 24.2.0 ``` Stable style - Fixed a bug where comments where mistakenly removed along with redundant parentheses (4218) Preview style - Move the `hug_parens_with_braces_and_square_brackets` feature to the unstable style due to an outstanding crash and proposed formatting tweaks (4198) - Fixed a bug where base expressions caused inconsistent formatting of \*\* in tenary expression (4154) - Checking for newline before adding one on docstring that is almost at the line limit (4185) - Remove redundant parentheses in `case` statement `if` guards (4214). Configuration - Fix issue where _Black_ would ignore input files in the presence of symlinks (4222) - _Black_ now ignores `pyproject.toml` that is missing a `tool.black` section when discovering project root and configuration. Since _Black_ continues to use version control as an indicator of project root, this is expected to primarily change behavior for users in a monorepo setup (desirably). If you wish to preserve previous behavior, simply add an empty `[tool.black]` to the previously discovered `pyproject.toml` (4204) Output - Black will swallow any `SyntaxWarning`s or `DeprecationWarning`s produced by the `ast` module when performing equivalence checks (4189) Integrations - Add a JSONSchema and provide a validate-pyproject entry-point (4181) ``` ### 24.1.1 ``` Bugfix release to fix a bug that made Black unusable on certain file systems with strict limits on path length. Preview style - Consistently add trailing comma on typed parameters (4164) Configuration - Shorten the length of the name of the cache file to fix crashes on file systems that do not support long paths (4176) ``` ### 24.1.0 ``` Highlights This release introduces the new 2024 stable style (4106), stabilizing the following changes: - Add parentheses around `if`-`else` expressions (2278) - Dummy class and function implementations consisting only of `...` are formatted more compactly (3796) - If an assignment statement is too long, we now prefer splitting on the right-hand side (3368) - Hex codes in Unicode escape sequences are now standardized to lowercase (2916) - Allow empty first lines at the beginning of most blocks (3967, 4061) - Add parentheses around long type annotations (3899) - Enforce newline after module docstrings (3932, 4028) - Fix incorrect magic trailing comma handling in return types (3916) - Remove blank lines before class docstrings (3692) - Wrap multiple context managers in parentheses if combined in a single `with` statement (3489) - Fix bug in line length calculations for power operations (3942) - Add trailing commas to collection literals even if there's a comment after the last entry (3393) - When using `--skip-magic-trailing-comma` or `-C`, trailing commas are stripped from subscript expressions with more than 1 element (3209) - Add extra blank lines in stubs in a few cases (3564, 3862) - Accept raw strings as docstrings (3947) - Split long lines in case blocks (4024) - Stop removing spaces from walrus operators within subscripts (3823) - Fix incorrect formatting of certain async statements (3609) - Allow combining ` fmt: skip` with other comments (3959) There are already a few improvements in the `--preview` style, which are slated for the 2025 stable style. Try them out and [share your feedback](https://github.com/psf/black/issues). In the past, the preview style has included some features that we were not able to stabilize. This year, we're adding a separate `--unstable` style for features with known problems. Now, the `--preview` style only includes features that we actually expect to make it into next year's stable style. Stable style Several bug fixes were made in features that are moved to the stable style in this release: - Fix comment handling when parenthesising conditional expressions (4134) - Fix bug where spaces were not added around parenthesized walruses in subscripts, unlike other binary operators (4109) - Remove empty lines before docstrings in async functions (4132) - Address a missing case in the change to allow empty lines at the beginning of all blocks, except immediately before a docstring (4130) - For stubs, fix logic to enforce empty line after nested classes with bodies (4141) Preview style - Add `--unstable` style, covering preview features that have known problems that would block them from going into the stable style. Also add the `--enable-unstable-feature` flag; for example, use `--enable-unstable-feature hug_parens_with_braces_and_square_brackets` to apply this preview feature throughout 2024, even if a later Black release downgrades the feature to unstable (4096) - Format module docstrings the same as class and function docstrings (4095) - Fix crash when using a walrus in a dictionary (4155) - Fix unnecessary parentheses when wrapping long dicts (4135) - Stop normalizing spaces before ` fmt: skip` comments (4146) Configuration - Print warning when configuration in `pyproject.toml` contains an invalid key (4165) - Fix symlink handling, properly ignoring symlinks that point outside of root (4161) - Fix cache mtime logic that resulted in false positive cache hits (4128) - Remove the long-deprecated `--experimental-string-processing` flag. This feature can currently be enabled with `--preview --enable-unstable-feature string_processing`. (4096) Integrations - Revert the change to run Black's pre-commit integration only on specific git hooks (3940) for better compatibility with older versions of pre-commit (4137) Thank you Thank you to everyone who provided feedback to help make Black's 2024 style even better. Thank you also to everyone who contributed code to Black. ``` ### 24.1a1 ``` This is a preview of the 2024 stable style, showing the formatting that Black will use in 2024. Please test it out and [share your feedback](https://github.com/psf/black/issues/4042). This applies the following changes: - Multiline strings passed as the sole function arguments are formatted more compactly (1879) - Dummy class and function implementations consisting only of `...` are formatted more compactly (3796) - If an assignment statement is too long, we now prefer splitting on the right-hand side (3368) - Hex codes in Unicode escape sequences are now standardized to lowercase (2916) - Allow empty first lines at the beginning of most blocks (3967, 4061) - Add parentheses around long type annotations (3899) - Standardize on a single newline after module docstrings (3932) - Fix incorrect magic trailing comma handling in return types (3916) - Remove blank lines before class docstrings (3692) - Wrap multiple context managers in parentheses if combined in a single `with` statement (3489) - Fix bug in line length calculations for power operations (3942) - Add trailing commas to collection literals even if there's a comment after the last entry (3393) - When using `--skip-magic-trailing-comma` or `-C`, trailing commas are stripped from subscript expressions with more than 1 element (3209) - Add extra blank lines in stubs in a few cases (3564, 3862) - Accept raw strings as docstrings (3947) - Split long lines in case blocks (4024) - Stop removing spaces from walrus operators within subscripts (3823) - Fix incorrect formatting of certain async statements (3609) - Allow combining ` fmt: skip` with other comments (3959) The following two changes may be included, but have outstanding issues that will need to be resolved: - Long values in dict literals are now wrapped in parentheses; correspondingly unnecessary parentheses around short values in dict literals are now removed; long string lambda values are now wrapped in parentheses (3440) - Add parentheses around `if`-`else` expressions (2278) ```
Links - PyPI: https://pypi.org/project/black - Changelog: https://data.safetycli.com/changelogs/black/

Update flake8-bugbear from 23.12.2 to 24.2.6.

Changelog ### 24.2.6 ``` * B902: Remove decorators named validator and root_validator from B902 checks (459) * B038: Change B038 to B909 and make it optional (456) ``` ### 24.1.17 ``` * B038: Restrict rule to mutation functions only (453) ``` ### 24.1.16 ``` * B036: Fix crash on ``raise`` statements raising something other than ``` ### 24.1.15 ``` * B038: Add check for mutations of loop iterator (446) * B037: Add check for yielding or returning values in __init__() (442) * B017: make B017 also apply to BaseException (439) * B036: Add check for except BaseException without re-raising (438) ```
Links - PyPI: https://pypi.org/project/flake8-bugbear - Changelog: https://data.safetycli.com/changelogs/flake8-bugbear/

Update twine from 4.0.2 to 5.0.0.

The bot wasn't able to find a changelog for this release. Got an idea?

Links - PyPI: https://pypi.org/project/twine - Docs: https://twine.readthedocs.io/

Update Faker from 22.2.0 to 23.3.0.

Changelog ### 23.3.0 ``` * Add person, bank provider for `sk_SK` locale. Thanks mhandl. ``` ### 23.2.1 ``` * fix: update `pydecimal` algorithm to ensure left part is not generated with a leading 0. Thanks alexei. ``` ### 23.2.0 ``` * Allow Uniqueness and Localization. Thanks moshemoshe137. ``` ### 23.1.0 ``` * Add `uk_UA` lorem provider. Thanks lozik. ``` ### 23.0.0 ``` * Consistently throw an error if the start of a daterange is after the end. Thanks prescod. ``` ### 22.7.0 ``` * Add `uk_UA` automotive provider. Thanks lozik. ``` ### 22.6.0 ``` * Add support for birthday and gender to `uk_UA` `ssn` method. Thanks lozik. ``` ### 22.5.1 ``` * Add area code `830000` to `zh_CN`. Thanks antik. * Add `area_code` parameter to `ssn` provider for `zh_CN`. Thanks antik. [v22.5.0 - 2024-01-22](https://github.com/joke2k/faker/compare/v22. 4.0...v22.5.0) * Add `http_status_code` to internet provider. Thanks dancergraham. [v22.4.0 - 2024-01-19](https://github.com/joke2k/faker/compare/v22. 3.0...v22.4.0) * Add `fa_IR` localization for currency provider. Thanks parsariyahi. ``` ### 22.3.0 ``` * Add bank provider for `uk_UA`. Thanks SanderFtn. ```
Links - PyPI: https://pypi.org/project/faker - Changelog: https://data.safetycli.com/changelogs/faker/ - Repo: https://github.com/joke2k/faker

Update pytest from 7.4.4 to 8.1.0.

Changelog ### 8.1.0 ``` ========================= Features -------- - `11475 <https://github.com/pytest-dev/pytest/issues/11475>`_: Added the new :confval:`consider_namespace_packages` configuration option, defaulting to ``False``. If set to ``True``, pytest will attempt to identify modules that are part of `namespace packages <https://packaging.python.org/en/latest/guides/packaging-namespace-packages>`__ when importing modules. - `11653 <https://github.com/pytest-dev/pytest/issues/11653>`_: Added the new :confval:`verbosity_test_cases` configuration option for fine-grained control of test execution verbosity. See :ref:`Fine-grained verbosity <pytest.fine_grained_verbosity>` for more details. Improvements ------------ - `10865 <https://github.com/pytest-dev/pytest/issues/10865>`_: :func:`pytest.warns` now validates that :func:`warnings.warn` was called with a `str` or a `Warning`. Currently in Python it is possible to use other types, however this causes an exception when :func:`warnings.filterwarnings` is used to filter those warnings (see `CPython 103577 <https://github.com/python/cpython/issues/103577>`__ for a discussion). While this can be considered a bug in CPython, we decided to put guards in pytest as the error message produced without this check in place is confusing. - `11311 <https://github.com/pytest-dev/pytest/issues/11311>`_: When using ``--override-ini`` for paths in invocations without a configuration file defined, the current working directory is used as the relative directory. Previoulsy this would raise an :class:`AssertionError`. - `11475 <https://github.com/pytest-dev/pytest/issues/11475>`_: :ref:`--import-mode=importlib <import-mode-importlib>` now tries to import modules using the standard import mechanism (but still without changing :py:data:`sys.path`), falling back to importing modules directly only if that fails. This means that installed packages will be imported under their canonical name if possible first, for example ``app.core.models``, instead of having the module name always be derived from their path (for example ``.env310.lib.site_packages.app.core.models``). - `11801 <https://github.com/pytest-dev/pytest/issues/11801>`_: Added the :func:`iter_parents() <_pytest.nodes.Node.iter_parents>` helper method on nodes. It is similar to :func:`listchain <_pytest.nodes.Node.listchain>`, but goes from bottom to top, and returns an iterator, not a list. - `11850 <https://github.com/pytest-dev/pytest/issues/11850>`_: Added support for :data:`sys.last_exc` for post-mortem debugging on Python>=3.12. - `11962 <https://github.com/pytest-dev/pytest/issues/11962>`_: In case no other suitable candidates for configuration file are found, a ``pyproject.toml`` (even without a ``[tool.pytest.ini_options]`` table) will be considered as the configuration file and define the ``rootdir``. - `11978 <https://github.com/pytest-dev/pytest/issues/11978>`_: Add ``--log-file-mode`` option to the logging plugin, enabling appending to log-files. This option accepts either ``"w"`` or ``"a"`` and defaults to ``"w"``. Previously, the mode was hard-coded to be ``"w"`` which truncates the file before logging. - `12047 <https://github.com/pytest-dev/pytest/issues/12047>`_: When multiple finalizers of a fixture raise an exception, now all exceptions are reported as an exception group. Previously, only the first exception was reported. Bug Fixes --------- - `11904 <https://github.com/pytest-dev/pytest/issues/11904>`_: Fixed a regression in pytest 8.0.0 that would cause test collection to fail due to permission errors when using ``--pyargs``. This change improves the collection tree for tests specified using ``--pyargs``, see :pull:`12043` for a comparison with pytest 8.0 and <8. - `12011 <https://github.com/pytest-dev/pytest/issues/12011>`_: Fixed a regression in 8.0.1 whereby ``setup_module`` xunit-style fixtures are not executed when ``--doctest-modules`` is passed. - `12014 <https://github.com/pytest-dev/pytest/issues/12014>`_: Fix the ``stacklevel`` used when warning about marks used on fixtures. - `12039 <https://github.com/pytest-dev/pytest/issues/12039>`_: Fixed a regression in ``8.0.2`` where tests created using :fixture:`tmp_path` have been collected multiple times in CI under Windows. Improved Documentation ---------------------- - `11790 <https://github.com/pytest-dev/pytest/issues/11790>`_: Documented the retention of temporary directories created using the ``tmp_path`` fixture in more detail. Trivial/Internal Changes ------------------------ - `11785 <https://github.com/pytest-dev/pytest/issues/11785>`_: Some changes were made to private functions which may affect plugins which access them: - ``FixtureManager._getautousenames()`` now takes a ``Node`` itself instead of the nodeid. - ``FixtureManager.getfixturedefs()`` now takes the ``Node`` itself instead of the nodeid. - The ``_pytest.nodes.iterparentnodeids()`` function is removed without replacement. Prefer to traverse the node hierarchy itself instead. If you really need to, copy the function from the previous pytest release. ``` ### 8.0.2 ``` ========================= Bug Fixes --------- - `11895 <https://github.com/pytest-dev/pytest/issues/11895>`_: Fix collection on Windows where initial paths contain the short version of a path (for example ``c:\PROGRA~1\tests``). - `11953 <https://github.com/pytest-dev/pytest/issues/11953>`_: Fix an ``IndexError`` crash raising from ``getstatementrange_ast``. - `12021 <https://github.com/pytest-dev/pytest/issues/12021>`_: Reverted a fix to `--maxfail` handling in pytest 8.0.0 because it caused a regression in pytest-xdist whereby session fixture teardowns may get executed multiple times when the max-fails is reached. ``` ### 8.0.1 ``` ========================= Bug Fixes --------- - `11875 <https://github.com/pytest-dev/pytest/issues/11875>`_: Correctly handle errors from :func:`getpass.getuser` in Python 3.13. - `11879 <https://github.com/pytest-dev/pytest/issues/11879>`_: Fix an edge case where ``ExceptionInfo._stringify_exception`` could crash :func:`pytest.raises`. - `11906 <https://github.com/pytest-dev/pytest/issues/11906>`_: Fix regression with :func:`pytest.warns` using custom warning subclasses which have more than one parameter in their `__init__`. - `11907 <https://github.com/pytest-dev/pytest/issues/11907>`_: Fix a regression in pytest 8.0.0 whereby calling :func:`pytest.skip` and similar control-flow exceptions within a :func:`pytest.warns()` block would get suppressed instead of propagating. - `11929 <https://github.com/pytest-dev/pytest/issues/11929>`_: Fix a regression in pytest 8.0.0 whereby autouse fixtures defined in a module get ignored by the doctests in the module. - `11937 <https://github.com/pytest-dev/pytest/issues/11937>`_: Fix a regression in pytest 8.0.0 whereby items would be collected in reverse order in some circumstances. ``` ### 8.0.0 ``` ========================= Bug Fixes --------- - `11842 <https://github.com/pytest-dev/pytest/issues/11842>`_: Properly escape the ``reason`` of a :ref:`skip <pytest.mark.skip ref>` mark when writing JUnit XML files. - `11861 <https://github.com/pytest-dev/pytest/issues/11861>`_: Avoid microsecond exceeds ``1_000_000`` when using ``log-date-format`` with ``%f`` specifier, which might cause the test suite to crash. ``` ### 8.0.0rc2 ``` ============================ Improvements ------------ - `11233 <https://github.com/pytest-dev/pytest/issues/11233>`_: Improvements to ``-r`` for xfailures and xpasses: * Report tracebacks for xfailures when ``-rx`` is set. * Report captured output for xpasses when ``-rX`` is set. * For xpasses, add ``-`` in summary between test name and reason, to match how xfail is displayed. - `11825 <https://github.com/pytest-dev/pytest/issues/11825>`_: The :hook:`pytest_plugin_registered` hook has a new ``plugin_name`` parameter containing the name by which ``plugin`` is registered. Bug Fixes --------- - `11706 <https://github.com/pytest-dev/pytest/issues/11706>`_: Fix reporting of teardown errors in higher-scoped fixtures when using `--maxfail` or `--stepwise`. NOTE: This change was reverted in pytest 8.0.2 to fix a `regression <https://github.com/pytest-dev/pytest-xdist/issues/1024>`_ it caused in pytest-xdist. - `11758 <https://github.com/pytest-dev/pytest/issues/11758>`_: Fixed ``IndexError: string index out of range`` crash in ``if highlighted[-1] == "\n" and source[-1] != "\n"``. This bug was introduced in pytest 8.0.0rc1. - `9765 <https://github.com/pytest-dev/pytest/issues/9765>`_, `#11816 <https://github.com/pytest-dev/pytest/issues/11816>`_: Fixed a frustrating bug that afflicted some users with the only error being ``assert mod not in mods``. The issue was caused by the fact that ``str(Path(mod))`` and ``mod.__file__`` don't necessarily produce the same string, and was being erroneously used interchangably in some places in the code. This fix also broke the internal API of ``PytestPluginManager.consider_conftest`` by introducing a new parameter -- we mention this in case it is being used by external code, even if marked as *private*. ``` ### 8.0.0rc1 ``` ============================ Breaking Changes ---------------- Old Deprecations Are Now Errors ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - `7363 <https://github.com/pytest-dev/pytest/issues/7363>`_: **PytestRemovedIn8Warning deprecation warnings are now errors by default.** Following our plan to remove deprecated features with as little disruption as possible, all warnings of type ``PytestRemovedIn8Warning`` now generate errors instead of warning messages by default. **The affected features will be effectively removed in pytest 8.1**, so please consult the :ref:`deprecations` section in the docs for directions on how to update existing code. In the pytest ``8.0.X`` series, it is possible to change the errors back into warnings as a stopgap measure by adding this to your ``pytest.ini`` file: .. code-block:: ini [pytest] filterwarnings = ignore::pytest.PytestRemovedIn8Warning But this will stop working when pytest ``8.1`` is released. **If you have concerns** about the removal of a specific feature, please add a comment to :issue:`7363`. Version Compatibility ^^^^^^^^^^^^^^^^^^^^^ - `11151 <https://github.com/pytest-dev/pytest/issues/11151>`_: Dropped support for Python 3.7, which `reached end-of-life on 2023-06-27 <https://devguide.python.org/versions/>`__. - ``pluggy>=1.3.0`` is now required. Collection Changes ^^^^^^^^^^^^^^^^^^ In this version we've made several breaking changes to pytest's collection phase, particularly around how filesystem directories and Python packages are collected, fixing deficiencies and allowing for cleanups and improvements to pytest's internals. A deprecation period for these changes was not possible. - `7777 <https://github.com/pytest-dev/pytest/issues/7777>`_: Files and directories are now collected in alphabetical order jointly, unless changed by a plugin. Previously, files were collected before directories. See below for an example. - `8976 <https://github.com/pytest-dev/pytest/issues/8976>`_: Running `pytest pkg/__init__.py` now collects the `pkg/__init__.py` file (module) only. Previously, it collected the entire `pkg` package, including other test files in the directory, but excluding tests in the `__init__.py` file itself (unless :confval:`python_files` was changed to allow `__init__.py` file). To collect the entire package, specify just the directory: `pytest pkg`. - `11137 <https://github.com/pytest-dev/pytest/issues/11137>`_: :class:`pytest.Package` is no longer a :class:`pytest.Module` or :class:`pytest.File`. The ``Package`` collector node designates a Python package, that is, a directory with an `__init__.py` file. Previously ``Package`` was a subtype of ``pytest.Module`` (which represents a single Python module), the module being the `__init__.py` file. This has been deemed a design mistake (see :issue:`11137` and :issue:`7777` for details). The ``path`` property of ``Package`` nodes now points to the package directory instead of the ``__init__.py`` file. Note that a ``Module`` node for ``__init__.py`` (which is not a ``Package``) may still exist, if it is picked up during collection (e.g. if you configured :confval:`python_files` to include ``__init__.py`` files). - `7777 <https://github.com/pytest-dev/pytest/issues/7777>`_: Added a new :class:`pytest.Directory` base collection node, which all collector nodes for filesystem directories are expected to subclass. This is analogous to the existing :class:`pytest.File` for file nodes. Changed :class:`pytest.Package` to be a subclass of :class:`pytest.Directory`. A ``Package`` represents a filesystem directory which is a Python package, i.e. contains an ``__init__.py`` file. :class:`pytest.Package` now only collects files in its own directory; previously it collected recursively. Sub-directories are collected as their own collector nodes, which then collect themselves, thus creating a collection tree which mirrors the filesystem hierarchy. Added a new :class:`pytest.Dir` concrete collection node, a subclass of :class:`pytest.Directory`. This node represents a filesystem directory, which is not a :class:`pytest.Package`, that is, does not contain an ``__init__.py`` file. Similarly to ``Package``, it only collects the files in its own directory. :class:`pytest.Session` now only collects the initial arguments, without recursing into directories. This work is now done by the :func:`recursive expansion process <pytest.Collector.collect>` of directory collector nodes. :attr:`session.name <pytest.Session.name>` is now ``""``; previously it was the rootdir directory name. This matches :attr:`session.nodeid <_pytest.nodes.Node.nodeid>` which has always been `""`. The collection tree now contains directories/packages up to the :ref:`rootdir <rootdir>`, for initial arguments that are found within the rootdir. For files outside the rootdir, only the immediate directory/package is collected -- note however that collecting from outside the rootdir is discouraged. As an example, given the following filesystem tree:: myroot/ pytest.ini top/ ├── aaa │ └── test_aaa.py ├── test_a.py ├── test_b │ ├── __init__.py │ └── test_b.py ├── test_c.py └── zzz ├── __init__.py └── test_zzz.py the collection tree, as shown by `pytest --collect-only top/` but with the otherwise-hidden :class:`~pytest.Session` node added for clarity, is now the following:: <Session> <Dir myroot> <Dir top> <Dir aaa> <Module test_aaa.py> <Function test_it> <Module test_a.py> <Function test_it> <Package test_b> <Module test_b.py> <Function test_it> <Module test_c.py> <Function test_it> <Package zzz> <Module test_zzz.py> <Function test_it> Previously, it was:: <Session> <Module top/test_a.py> <Function test_it> <Module top/test_c.py> <Function test_it> <Module top/aaa/test_aaa.py> <Function test_it> <Package test_b> <Module test_b.py> <Function test_it> <Package zzz> <Module test_zzz.py> <Function test_it> Code/plugins which rely on a specific shape of the collection tree might need to update. - `11676 <https://github.com/pytest-dev/pytest/issues/11676>`_: The classes :class:`~_pytest.nodes.Node`, :class:`~pytest.Collector`, :class:`~pytest.Item`, :class:`~pytest.File`, :class:`~_pytest.nodes.FSCollector` are now marked abstract (see :mod:`abc`). We do not expect this change to affect users and plugin authors, it will only cause errors when the code is already wrong or problematic. Other breaking changes ^^^^^^^^^^^^^^^^^^^^^^ These are breaking changes where deprecation was not possible. - `11282 <https://github.com/pytest-dev/pytest/issues/11282>`_: Sanitized the handling of the ``default`` parameter when defining configuration options. Previously if ``default`` was not supplied for :meth:`parser.addini <pytest.Parser.addini>` and the configuration option value was not defined in a test session, then calls to :func:`config.getini <pytest.Config.getini>` returned an *empty list* or an *empty string* depending on whether ``type`` was supplied or not respectively, which is clearly incorrect. Also, ``None`` was not honored even if ``default=None`` was used explicitly while defining the option. Now the behavior of :meth:`parser.addini <pytest.Parser.addini>` is as follows: * If ``default`` is NOT passed but ``type`` is provided, then a type-specific default will be returned. For example ``type=bool`` will return ``False``, ``type=str`` will return ``""``, etc. * If ``default=None`` is passed and the option is not defined in a test session, then ``None`` will be returned, regardless of the ``type``. * If neither ``default`` nor ``type`` are provided, assume ``type=str`` and return ``""`` as default (this is as per previous behavior). The team decided to not introduce a deprecation period for this change, as doing so would be complicated both in terms of communicating this to the community as well as implementing it, and also because the team believes this change should not break existing plugins except in rare cases. - `11667 <https://github.com/pytest-dev/pytest/issues/11667>`_: pytest's ``setup.py`` file is removed. If you relied on this file, e.g. to install pytest using ``setup.py install``, please see `Why you shouldn't invoke setup.py directly <https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html#summary>`_ for alternatives. - `9288 <https://github.com/pytest-dev/pytest/issues/9288>`_: :func:`~pytest.warns` now re-emits unmatched warnings when the context closes -- previously it would consume all warnings, hiding those that were not matched by the function. While this is a new feature, we announce it as a breaking change because many test suites are configured to error-out on warnings, and will therefore fail on the newly-re-emitted warnings. - The internal ``FixtureManager.getfixtureclosure`` method has changed. Plugins which use this method or which subclass ``FixtureManager`` and overwrite that method will need to adapt to the change. Deprecations ------------ - `10465 <https://github.com/pytest-dev/pytest/issues/10465>`_: Test functions returning a value other than ``None`` will now issue a :class:`pytest.PytestWarning` instead of ``pytest.PytestRemovedIn8Warning``, meaning this will stay a warning instead of becoming an error in the future. - `3664 <https://github.com/pytest-dev/pytest/issues/3664>`_: Applying a mark to a fixture function now issues a warning: marks in fixtures never had any effect, but it is a common user error to apply a mark to a fixture (for example ``usefixtures``) and expect it to work. This will become an error in pytest 9.0. Features and Improvements ------------------------- Improved Diffs ^^^^^^^^^^^^^^ These changes improve the diffs that pytest prints when an assertion fails. Note that syntax highlighting requires the ``pygments`` package. - `11520 <https://github.com/pytest-dev/pytest/issues/11520>`_: The very verbose (``-vv``) diff output is now colored as a diff instead of a big chunk of red. Python code in error reports is now syntax-highlighted as Python. The sections in the error reports are now better separated. - `1531 <https://github.com/pytest-dev/pytest/issues/1531>`_: The very verbose diff (``-vv``) for every standard library container type is improved. The indentation is now consistent and the markers are on their own separate lines, which should reduce the diffs shown to users. Previously, the standard Python pretty printer was used to generate the output, which puts opening and closing markers on the same line as the first/last entry, in addition to not having consistent indentation. - `10617 <https://github.com/pytest-dev/pytest/issues/10617>`_: Added more comprehensive set assertion rewrites for comparisons other than equality ``==``, with the following operations now providing better failure messages: ``!=``, ``<=``, ``>=``, ``<``, and ``>``. Separate Control For Assertion Verbosity ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - `11387 <https://github.com/pytest-dev/pytest/issues/11387>`_: Added the new :confval:`verbosity_assertions` configuration option for fine-grained control of failed assertions verbosity. If you've ever wished that pytest always show you full diffs, but without making everything else verbose, this is for you. See :ref:`Fine-grained verbosity <pytest.fine_grained_verbosity>` for more details. For plugin authors, :attr:`config.get_verbosity <pytest.Config.get_verbosity>` can be used to retrieve the verbosity level for a specific verbosity type. Additional Support For Exception Groups and ``__notes__`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ These changes improve pytest's support for exception groups. - `10441 <https://github.com/pytest-dev/pytest/issues/10441>`_: Added :func:`ExceptionInfo.group_contains() <pytest.ExceptionInfo.group_contains>`, an assertion helper that tests if an :class:`ExceptionGroup` contains a matching exception. See :ref:`assert-matching-exception-groups` for an example. - `11227 <https://github.com/pytest-dev/pytest/issues/11227>`_: Allow :func:`pytest.raises` ``match`` argument to match against `PEP-678 <https://peps.python.org/pep-0678/>` ``__notes__``. Custom Directory collectors ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - `7777 <https://github.com/pytest-dev/pytest/issues/7777>`_: Added a new hook :hook:`pytest_collect_directory`, which is called by filesystem-traversing collector nodes, such as :class:`pytest.Session`, :class:`pytest.Dir` and :class:`pytest.Package`, to create a collector node for a sub-directory. It is expected to return a subclass of :class:`pytest.Directory`. This hook allows plugins to :ref:`customize the collection of directories <custom directory collectors>`. "New-style" Hook Wrappers ^^^^^^^^^^^^^^^^^^^^^^^^^ - `11122 <https://github.com/pytest-dev/pytest/issues/11122>`_: pytest now uses "new-style" hook wrappers internally, available since pluggy 1.2.0. See `pluggy's 1.2.0 changelog <https://pluggy.readthedocs.io/en/latest/changelog.html#pluggy-1-2-0-2023-06-21>`_ and the :ref:`updated docs <hookwrapper>` for details. Plugins which want to use new-style wrappers can do so if they require ``pytest>=8``. Other Improvements ^^^^^^^^^^^^^^^^^^ - `11216 <https://github.com/pytest-dev/pytest/issues/11216>`_: If a test is skipped from inside an :ref:`xunit setup fixture <classic xunit>`, the test summary now shows the test location instead of the fixture location. - `11314 <https://github.com/pytest-dev/pytest/issues/11314>`_: Logging to a file using the ``--log-file`` option will use ``--log-level``, ``--log-format`` and ``--log-date-format`` as fallback if ``--log-file-level``, ``--log-file-format`` and ``--log-file-date-format`` are not provided respectively. - `11610 <https://github.com/pytest-dev/pytest/issues/11610>`_: Added the :func:`LogCaptureFixture.filtering() <pytest.LogCaptureFixture.filtering>` context manager which adds a given :class:`logging.Filter` object to the :fixture:`caplog` fixture. - `11447 <https://github.com/pytest-dev/pytest/issues/11447>`_: :func:`pytest.deprecated_call` now also considers warnings of type :class:`FutureWarning`. - `11600 <https://github.com/pytest-dev/pytest/issues/11600>`_: Improved the documentation and type signature for :func:`pytest.mark.xfail <pytest.mark.xfail>`'s ``condition`` param to use ``False`` as the default value. - `7469 <https://github.com/pytest-dev/pytest/issues/7469>`_: :class:`~pytest.FixtureDef` is now exported as ``pytest.FixtureDef`` for typing purposes. - `11353 <https://github.com/pytest-dev/pytest/issues/11353>`_: Added typing to :class:`~pytest.PytestPluginManager`. Bug Fixes --------- - `10701 <https://github.com/pytest-dev/pytest/issues/10701>`_: :meth:`pytest.WarningsRecorder.pop` will return the most-closely-matched warning in the list, rather than the first warning which is an instance of the requested type. - `11255 <https://github.com/pytest-dev/pytest/issues/11255>`_: Fixed crash on `parametrize(..., scope="package")` without a package present. - `11277 <https://github.com/pytest-dev/pytest/issues/11277>`_: Fixed a bug that when there are multiple fixtures for an indirect parameter, the scope of the highest-scope fixture is picked for the parameter set, instead of that of the one with the narrowest scope. - `11456 <https://github.com/pytest-dev/pytest/issues/11456>`_: Parametrized tests now *really do* ensure that the ids given to each input are unique - for example, ``a, a, a0`` now results in ``a1, a2, a0`` instead of the previous (buggy) ``a0, a1, a0``. This necessarily means changing nodeids where these were previously colliding, and for readability adds an underscore when non-unique ids end in a number. - `11563 <https://github.com/pytest-dev/pytest/issues/11563>`_: Fixed a crash when using an empty string for the same parametrized value more than once. - `11712 <https://github.com/pytest-dev/pytest/issues/11712>`_: Fixed handling ``NO_COLOR`` and ``FORCE_COLOR`` to ignore an empty value. - `9036 <https://github.com/pytest-dev/pytest/issues/9036>`_: ``pytest.warns`` and similar functions now capture warnings when an exception is raised inside a ``with`` block. Improved Documentation ---------------------- - `11011 <https://github.com/pytest-dev/pytest/issues/11011>`_: Added a warning about modifying the root logger during tests when using ``caplog``. - `11065 <https://github.com/pytest-dev/pytest/issues/11065>`_: Use ``pytestconfig`` instead of ``request.config`` in cache example to be consistent with the API documentation. Trivial/Internal Changes ------------------------ - `11208 <https://github.com/pytest-dev/pytest/issues/11208>`_: The (internal) ``FixtureDef.cached_result`` type has changed. Now the third item ``cached_result[2]``, when set, is an exception instance instead of an exception triplet. - `11218 <https://github.com/pytest-dev/pytest/issues/11218>`_: (This entry is meant to assist plugins which access private pytest internals to instantiate ``FixtureRequest`` objects.) :class:`~pytest.FixtureRequest` is now an abstract class which can't be instantiated directly. A new concrete ``TopRequest`` subclass of ``FixtureRequest`` has been added for the ``request`` fixture in test functions, as counterpart to the existing ``SubRequest`` subclass for the ``request`` fixture in fixture functions. - `11315 <https://github.com/pytest-dev/pytest/issues/11315>`_: The :fixture:`pytester` fixture now uses the :fixture:`monkeypatch` fixture to manage the current working directory. If you use ``pytester`` in combination with :func:`monkeypatch.undo() <pytest.MonkeyPatch.undo>`, the CWD might get restored. Use :func:`monkeypatch.context() <pytest.MonkeyPatch.context>` instead. - `11333 <https://github.com/pytest-dev/pytest/issues/11333>`_: Corrected the spelling of ``Config.ArgsSource.INVOCATION_DIR``. The previous spelling ``INCOVATION_DIR`` remains as an alias. - `11638 <https://github.com/pytest-dev/pytest/issues/11638>`_: Fixed the selftests to pass correctly if ``FORCE_COLOR``, ``NO_COLOR`` or ``PY_COLORS`` is set in the calling environment. ```
Links - PyPI: https://pypi.org/project/pytest - Changelog: https://data.safetycli.com/changelogs/pytest/

Update pytest-django from 4.7.0 to 4.8.0.

Changelog ### 4.8.0 ``` https://pytest-django.readthedocs.io/en/latest/changelog.html#v4-8-0-2024-01-30 ```
Links - PyPI: https://pypi.org/project/pytest-django - Changelog: https://data.safetycli.com/changelogs/pytest-django/

Update syrupy from 4.6.0 to 4.6.1.

Changelog ### 4.6.1 ``` [4.6.1](https://github.com/tophat/syrupy/compare/v4.6.0...v4.6.1) (2024-02-07) Bug Fixes * support pytest 8 ([855](https://github.com/tophat/syrupy/issues/855)) ([3175615](https://github.com/tophat/syrupy/commit/3175615a31bde0cdac6ec4a18d4a9285001d5d21)) ```
Links - PyPI: https://pypi.org/project/syrupy - Changelog: https://data.safetycli.com/changelogs/syrupy/ - Repo: https://github.com/tophat/syrupy