Commit Graph

11 Commits

Author SHA1 Message Date
jakkdl 857daa8081 disable gc within the subprocess 2025-02-04 12:20:26 +01:00
Thomas Grainger 868e1d225e
apply warnings filter as soon as possible, and remove it as late as possible (#13057)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-18 11:09:33 +00:00
Thomas Grainger ea1a79a93a
threadexception enhancements (#13016) 2024-12-04 21:19:49 +00:00
Thomas Grainger 4b32e7cc33
Enhancements to unraisable plugin (#12958)
A number of `unraisable` plugin enhancements:

* Set the unraisablehook as early as possible and unset it as late as possible, to collect the most possible unraisable exceptions (please let me know if there's an earlier or later hook I can use).
* Call the garbage collector just before unsetting the unraisablehook, to collect any straggling exceptions
* Collect multiple unraisable exceptions per test phase.
* Report the tracemalloc allocation traceback, if available.
* Avoid using a generator based hook to allow handling StopIteration in test failures
* Report the unraisable exception as the cause of the PytestUnraisableExceptionWarning exception if raised.
* Compute the repr of the unraisable.object in the unraisablehook so you get the latest information if available, and should help with resurrection of the object.

Co-authored-by: Ran Benita <ran@unusedvar.com>
Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
2024-11-30 18:17:32 -03:00
Ronny Pfannschmidt 9295f9ffff RFC: from __future__ import annotations + migrate 2024-06-20 11:03:03 +02:00
Pierre Sassoulas 4588653b24 Migrate from autoflake, black, isort, pyupgrade, flake8 and pydocstyle, to ruff
ruff is faster and handle everything we had prior.

isort configuration done based on the indication from
https://github.com/astral-sh/ruff/issues/4670, previousely based on
reorder-python-import (#11896)

flake8-docstrings was a wrapper around pydocstyle (now archived) that
explicitly asks to use ruff in https://github.com/PyCQA/pydocstyle/pull/658.

flake8-typing-import is useful mainly for project that support python 3.7
and the one useful check will be implemented in https://github.com/astral-sh/ruff/issues/2302

We need to keep blacken-doc because ruff does not handle detection
of python code inside .md and .rst. The direct link to the repo is
now used to avoid a redirection.

Manual fixes:
- Lines that became too long
- % formatting that was not done automatically
- type: ignore that were moved around
- noqa of hard to fix issues (UP031 generally)
- fmt: off and fmt: on that is not really identical
  between black and ruff
- autofix re-order in pre-commit from faster to slower

Co-authored-by: Ran Benita <ran@unusedvar.com>
2024-02-02 09:27:00 +01:00
Zac Hatfield-Dodds 0353a94cd1 Explicit GC for PyPy, take 2 2023-06-30 20:33:12 -07:00
Zac Hatfield-Dodds 7fdc8391e2 Explicit GC for PyPy 2023-06-30 16:23:18 -07:00
Zac Hatfield-Dodds f4e3b4ad98 Drop Python 3.7 2023-06-30 14:55:42 -07:00
Florian Bruhin e354c5c919 Fix warning filters used in tests 2021-05-04 17:25:02 +02:00
Ran Benita d50df85e26 Add unraisableexception and threadexception plugins 2020-11-21 21:11:48 +02:00