Age | Commit message (Collapse) | Author |
|
|
|
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
|
|
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`.
|
|
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>
|
|
|
|
|
|
|
|
Annotate some "easy" arguments of hooks that repeat in a lot of internal
plugins.
Not all of the arguments are annotated fully for now.
|
|
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
|
|
It should happen as late as possible before the test runs.
Ref: https://github.com/pytest-dev/pytest/issues/7022
|
|
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.
|
|
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>
|
|
* 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
|
|
* Add pytest-faulthandler files unchanged
* Adapt imports and tests
* Add code to skip registration of the external `pytest_faulthandler`
to avoid conflicts
Fix #5440
|