├── .gitignore ├── .travis.yml ├── CHANGELOG.rst ├── LICENSE ├── MANIFEST.in ├── README.rst ├── setup.cfg └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.eggs 24 | 25 | # PyInstaller 26 | # Usually these files are written by a python script from a template 27 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 28 | *.manifest 29 | *.spec 30 | 31 | # Installer logs 32 | pip-log.txt 33 | pip-delete-this-directory.txt 34 | 35 | # Unit test / coverage reports 36 | htmlcov/ 37 | .tox/ 38 | .coverage 39 | .cache 40 | nosetests.xml 41 | coverage.xml 42 | 43 | # Translations 44 | *.mo 45 | *.pot 46 | 47 | # Django stuff: 48 | *.log 49 | 50 | # Sphinx documentation 51 | docs/_build/ 52 | 53 | # PyBuilder 54 | target/ 55 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | dist: xenial 3 | 4 | install: skip 5 | 6 | script: skip 7 | 8 | stages: 9 | - name: deploy 10 | if: repo = pytest-dev/pytest-faulthandler AND tag IS present 11 | 12 | jobs: 13 | include: 14 | - stage: test 15 | # python envs above are already included into this stage 16 | 17 | - stage: deploy 18 | python: '3.6' 19 | env: 20 | install: pip install -U setuptools setuptools_scm 21 | script: skip 22 | deploy: 23 | provider: pypi 24 | user: nicoddemus 25 | distributions: sdist bdist_wheel 26 | skip_upload_docs: true 27 | password: 28 | secure: QK8ibmCJZeyO9Homs0BljGKNXVQFicw9YhOBozofYZRxexVjUqCGr78BfXPvLcBuAnHcM0XCuzQOMaBIS1T5gi5jiF/hZXxtLfIdzZoxxBTyHyVV6quhzjXJsWC9ILT3GXmhhGiY/eJLCJbPn//uFeEAPYxKST2ANBoxieAfuko= 29 | on: 30 | tags: true 31 | repo: pytest-dev/pytest-faulthandler 32 | 33 | -------------------------------------------------------------------------------- /CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | 2.0.1 2 | ----- 3 | 4 | * This release is a dummy package requiring pytest 5.0: this plugin has 5 | been integrated into pytest 5.0, so this plugin should no longer 6 | be required (`#36`_). 7 | 8 | Maintenance also has been moved to pytest core. 9 | 10 | .. _#36: https://github.com/pytest-dev/pytest-faulthandler/issues/36 11 | 12 | 13 | 1.6.0 14 | ----- 15 | 16 | * The warning about fault-handler timeout not being supported in some platforms 17 | has been moved to the section header (`#32`_). 18 | 19 | * pytest 4.0+ is now required. 20 | 21 | .. _#32: https://github.com/pytest-dev/pytest-faulthandler/issues/32 22 | 23 | 1.5.0 24 | ----- 25 | 26 | * Support installation in PyPy (`#28`_). Thanks `@lazka`_ for the PR. 27 | 28 | .. _#28: https://github.com/pytest-dev/pytest-faulthandler/pull/28 29 | 30 | 1.4.1 31 | ----- 32 | 33 | * Drop support for Python 2.6 and Python 3.3. 34 | * Fix crash when using pytester in default mode with newer pytest versions (`#24`_). 35 | Thanks `@njsmith`_ for the patch. 36 | 37 | .. _#24: https://github.com/pytest-dev/pytest-faulthandler/pull/24 38 | 39 | 1.4.0 40 | ----- 41 | 42 | * Botched release, never published to PyPI. 43 | 44 | 1.3.1 45 | ----- 46 | 47 | * Fix compatibility with xdist's looponfail mode (`#19`_). 48 | Patch by `@mhils`_. 49 | 50 | .. _#19: https://github.com/pytest-dev/pytest-faulthandler/issues/19 51 | 52 | 1.3.0 53 | ----- 54 | 55 | * Now traceback dumping due to an interactive exception is raised (`#14`_). 56 | Thanks to `@flub`_ for the request. 57 | 58 | .. _#14: https://github.com/pytest-dev/pytest-faulthandler/issues/14 59 | 60 | 61 | 1.2.0 62 | ----- 63 | 64 | * Now traceback dumping due to a timeout is cancelled when entering 65 | ``pdb``. Thanks to `@The-Compiler`_ for the request (`#12`_). 66 | 67 | .. _#12: https://github.com/pytest-dev/pytest-faulthandler/issues/12 68 | 69 | 1.1.0 70 | ----- 71 | 72 | * ``--faulthandler-timeout`` option is now properly supported in Python 3+; 73 | also a warning is issued instead of an error on platforms without a 74 | ``faulthandler.dump_traceback_later`` function (`#8`_). 75 | 76 | 77 | .. _#8: https://github.com/pytest-dev/pytest-faulthandler/issues/8 78 | 79 | 80 | 1.0.1 81 | ----- 82 | 83 | Release to ensure Python 3.5 compatibility and to provide wheels on PyPI again. 84 | 85 | 86 | 1.0 87 | ---- 88 | 89 | First 1.0 release. 90 | 91 | 0.2 92 | ---- 93 | 94 | Now properly closing the stream used by the fault handler, thanks to complete 95 | PR by `@The-Compiler`_. Many thanks! 96 | 97 | 98 | 0.1 99 | ---- 100 | 101 | First public release 102 | 103 | 104 | .. _@flub: https://github.com/flub 105 | .. _@lazka: https://github.com/lazka 106 | .. _@mhils: https://github.com/mhils 107 | .. _@njsmith: https://github.com/njsmith 108 | .. _@The-Compiler: https://github.com/The-Compiler 109 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Bruno Oliveira 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | pytest-faulthandler 3 | =================== 4 | 5 | 6 | Plugin for pytest that automatically enables the 7 | `faulthandler `_ module during tests. 8 | 9 | Inspired by the 10 | `nose faulthandler `_ plugin. 11 | 12 | **This plugin is now part of pytest core since pytest 5.0, so users should not install this plugin together with that pytest version.** 13 | 14 | **Version 2.0.0 of this package is a dummy package for pytest 5.0 compatibility**. 15 | 16 | 17 | Usage 18 | ===== 19 | 20 | The plugin is always active by default, but you can disable it by passing 21 | ``--no-faulthandler`` to ``py.test``. 22 | 23 | Options: 24 | 25 | * ``--faulthandler-timeout=TIMEOUT``: Dump the traceback of all threads if a 26 | test takes more than TIMEOUT seconds to finish. 27 | 28 | 29 | Requirements 30 | ============ 31 | 32 | * Python 2.7+, Python 3.4+ 33 | * pytest 34 | * faulthandler (Python 2.7) 35 | 36 | 37 | Install 38 | ======= 39 | 40 | Install using `pip `_: 41 | 42 | .. code-block:: console 43 | 44 | $ pip install pytest-faulthandler 45 | 46 | Change Log 47 | ========== 48 | 49 | Please consult the `CHANGELOG`_. 50 | 51 | .. _CHANGELOG: https://github.com/pytest-dev/pytest-faulthandler/blob/master/CHANGELOG.rst 52 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_wheel] 2 | universal=1 3 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | 4 | with open('README.rst') as f: 5 | long_description = f.read() 6 | 7 | setup( 8 | name='pytest-faulthandler', 9 | version="2.0.1", 10 | url='https://github.com/pytest-dev/pytest-faulthandler', 11 | license='MIT', 12 | install_requires=['pytest>=5.0'], 13 | author='Bruno Oliveira', 14 | author_email='nicoddemus@gmail.com', 15 | description='py.test plugin that activates the fault handler module for tests (dummy package)', 16 | long_description=long_description, 17 | keywords='pytest faulthandler', 18 | classifiers=[ 19 | 'Development Status :: 6 - Mature', 20 | 'Framework :: Pytest', 21 | 'Intended Audience :: Developers', 22 | 'License :: OSI Approved :: MIT License', 23 | 'Operating System :: OS Independent', 24 | 'Topic :: Software Development :: Testing', 25 | ] 26 | ) 27 | --------------------------------------------------------------------------------