summaryrefslogtreecommitdiff
path: root/src/_pytest/faulthandler.py
AgeCommit message (Collapse)Author
2021-01-25Only re-enable fauthandler during unconfigure if it was enabled beforeBruno Oliveira
2021-01-20Always handle faulthandler stderr even if already enabledBruno Oliveira
It seems the code that would not install pytest's faulthandler support if it was already enabled is not really needed at all, and even detrimental when using `python -X dev -m pytest` to run Python in "dev" mode. Also simplified the plugin by removing the hook class, now the hooks will always be active so there's no need to delay the hook definitions anymore. Fix #8258
2021-01-18Fix faulthandler for Twisted Logger when used with "--capture=no"Andreas Motl
The Twisted Logger will return an invalid file descriptor since it is not backed by an FD. So, let's also forward this to the same code path as with `pytest-xdist`.
2020-09-04Integrate warnings filtering directly into Config (#7700)Bruno Oliveira
Warnings are a central part of Python, so much that Python itself has command-line and environtment variables to handle warnings. By moving the concept of warning handling into Config, it becomes natural to filter warnings issued as early as possible, even before the "_pytest.warnings" plugin is given a chance to spring into action. This also avoids the weird coupling between config and the warnings plugin that was required before. Fix #6681 Fix #2891 Fix #7620 Fix #7626 Close #7649 Co-authored-by: Ran Benita <ran@unusedvar.com>
2020-08-01Format docstrings in a consistent styleRan Benita
2020-06-05Type annotate _pytest.debugging (a bit)Ran Benita
2020-06-05Type annotate some more hooks & implsRan Benita
2020-06-05Type annotate some hookspecs & implsRan Benita
Annotate some "easy" arguments of hooks that repeat in a lot of internal plugins. Not all of the arguments are annotated fully for now.
2020-04-10Remove note saying faulthandler_timeout is not available on WindowsRan Benita
I think it is available in all Python versions we support, but at least since Python 3.7 the docs[0] say: Changed in version 3.7: This function is now always available. so let's just remove the note. [0] https://docs.python.org/3/library/faulthandler.html#faulthandler.dump_traceback_later
2020-04-09faulthandler: trylast=True (#7025)Daniel Hahler
It should happen as late as possible before the test runs. Ref: https://github.com/pytest-dev/pytest/issues/7022
2020-02-28Add a typing-compatible mechanism for ad-hoc attributes on various objectsRan Benita
pytest has several instances where plugins set their own attributes on objects they receive in hooks, like nodes and config. Since plugins are detached from these object's definition by design, this causes a problem for type checking because these attributes are not defined and mypy complains. Fix this by giving these objects a "store" which can be used by plugins in a type-safe manner. Currently this mechanism is private. We can consider exposing it at a later point.
2020-02-12Fix crash when faulthandler starts initialized (#6598)Bruno Oliveira
Use suggestion in review and use a subplugin so hooks will only be active if we enable faulthandler ourselves. Fix #6575 Co-authored-by: Daniel Hahler <git@thequod.de>
2019-06-22Change pytest-faulthandler for simplificationBruno Oliveira
* The --no-faulthandler option is not necessary given that we can use `-p no:faulthandler`. * The `--faulthandler-timeout` command-line option has become an ini option, for the reasons described in https://github.com/pytest-dev/pytest-faulthandler/issues/34 and users can still set it from the command-line. Fix pytest-dev/pytest-faulthandler#34
2019-06-21Integrate pytest-faulthandler into the coreBruno Oliveira
* Add pytest-faulthandler files unchanged * Adapt imports and tests * Add code to skip registration of the external `pytest_faulthandler` to avoid conflicts Fix #5440