././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1592128049.1304548 pytest-instafail-0.4.2/0000755000076500000240000000000000000000000015234 5ustar00jannestaff00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1592127842.0 pytest-instafail-0.4.2/CHANGES.rst0000644000076500000240000000264000000000000017040 0ustar00jannestaff00000000000000Changelog --------- Here you can see the full list of changes between each pytest-instafail release. 0.4.2 (June 14, 2020) ^^^^^^^^^^^^^^^^^^^^^ - Fixed usage of deprecated pytest-xdist slave aliases (#20). - Fixed failing tests on pytest 5 0.4.1 (February 15, 2019) ^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed compatibility with pytest 4.2.0. Thanks @blueyed for the PR. 0.4.0 (May 19, 2018) ^^^^^^^^^^^^^^^^^^^^ - Added support for Python 3.5, 3.6, and 3.7. - Dropped support for Python 2.7, 3.2, and 3.3. - Dropped support for pytest < 2.9. - Only rewrite lines on tty. Previously you would end up with a \r (^M) in case collecting of tests failed, and pytest's output is piped to a file. Thanks @blueyed for the PR. - Support -p no:terminal (#12). Thanks @Maratori for the PR. 0.3.0 (August 30, 2014) ^^^^^^^^^^^^^^^^^^^^^^^ - Added support for Python 3.4 - Added support for pytest 2.6 - Fixed failing tests on pytest 2.6 0.2.0 (March 6, 2014) ^^^^^^^^^^^^^^^^^^^^^ - Dropped support for Python 2.5. - Fixed stacktrace printed twice when using PDB. - Fixed internal error when a test marked as xfailing unexpectedly passes (David Szotten). 0.1.1 (November 9, 2013) ^^^^^^^^^^^^^^^^^^^^^^^^ - Made pytest-instafail compatible with `pytest-xdist`_'s test parallelization (Ronny Pfannschmidt). 0.1.0 (April 8, 2013) ^^^^^^^^^^^^^^^^^^^^^ - Initial public release .. _`pytest-xdist`: http://pypi.python.org/pypi/pytest-xdist ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1573408321.0 pytest-instafail-0.4.2/LICENSE0000644000076500000240000000263600000000000016250 0ustar00jannestaff00000000000000Copyright (c) 2013-2016, Janne Vanhala All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1573408321.0 pytest-instafail-0.4.2/MANIFEST.in0000644000076500000240000000014200000000000016767 0ustar00jannestaff00000000000000include CHANGES.rst include README.rst include setup.py include LICENSE include test_instafail.py ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1592128049.1306636 pytest-instafail-0.4.2/PKG-INFO0000644000076500000240000000461000000000000016332 0ustar00jannestaff00000000000000Metadata-Version: 1.2 Name: pytest-instafail Version: 0.4.2 Summary: pytest plugin to show failures instantly Home-page: https://github.com/pytest-dev/pytest-instafail Author: Janne Vanhala Author-email: janne.vanhala@gmail.com License: BSD Description: pytest-instafail ================ |build status|_ .. |build status| image:: https://travis-ci.org/pytest-dev/pytest-instafail.svg?branch=master :alt: Build Status .. _build status: https://travis-ci.org/pytest-dev/pytest-instafail pytest-instafail is a plugin for `pytest `_ that shows failures and errors instantly instead of waiting until the end of test session. Requirements ------------ You will need the following prerequisites in order to use pytest-instafail: - Python 2.7, 3.5+ or PyPy - pytest 2.9 or newer Installation ------------ To install pytest-instafail:: $ pip install pytest-instafail Then run your tests with:: $ pytest --instafail Resources --------- - `Issue Tracker `_ - `Code `_ - `Development Version `_ Platform: any Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: POSIX Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: MacOS :: MacOS X Classifier: Topic :: Software Development :: Testing Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Utilities Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: PyPy Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1592125403.0 pytest-instafail-0.4.2/README.rst0000644000076500000240000000170700000000000016730 0ustar00jannestaff00000000000000pytest-instafail ================ |build status|_ .. |build status| image:: https://travis-ci.org/pytest-dev/pytest-instafail.svg?branch=master :alt: Build Status .. _build status: https://travis-ci.org/pytest-dev/pytest-instafail pytest-instafail is a plugin for `pytest `_ that shows failures and errors instantly instead of waiting until the end of test session. Requirements ------------ You will need the following prerequisites in order to use pytest-instafail: - Python 2.7, 3.5+ or PyPy - pytest 2.9 or newer Installation ------------ To install pytest-instafail:: $ pip install pytest-instafail Then run your tests with:: $ pytest --instafail Resources --------- - `Issue Tracker `_ - `Code `_ - `Development Version `_ ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1592128049.1301575 pytest-instafail-0.4.2/pytest_instafail.egg-info/0000755000076500000240000000000000000000000022310 5ustar00jannestaff00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1592128049.0 pytest-instafail-0.4.2/pytest_instafail.egg-info/PKG-INFO0000644000076500000240000000461000000000000023406 0ustar00jannestaff00000000000000Metadata-Version: 1.2 Name: pytest-instafail Version: 0.4.2 Summary: pytest plugin to show failures instantly Home-page: https://github.com/pytest-dev/pytest-instafail Author: Janne Vanhala Author-email: janne.vanhala@gmail.com License: BSD Description: pytest-instafail ================ |build status|_ .. |build status| image:: https://travis-ci.org/pytest-dev/pytest-instafail.svg?branch=master :alt: Build Status .. _build status: https://travis-ci.org/pytest-dev/pytest-instafail pytest-instafail is a plugin for `pytest `_ that shows failures and errors instantly instead of waiting until the end of test session. Requirements ------------ You will need the following prerequisites in order to use pytest-instafail: - Python 2.7, 3.5+ or PyPy - pytest 2.9 or newer Installation ------------ To install pytest-instafail:: $ pip install pytest-instafail Then run your tests with:: $ pytest --instafail Resources --------- - `Issue Tracker `_ - `Code `_ - `Development Version `_ Platform: any Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: POSIX Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: MacOS :: MacOS X Classifier: Topic :: Software Development :: Testing Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Utilities Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: PyPy Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1592128049.0 pytest-instafail-0.4.2/pytest_instafail.egg-info/SOURCES.txt0000644000076500000240000000057400000000000024202 0ustar00jannestaff00000000000000CHANGES.rst LICENSE MANIFEST.in README.rst pytest_instafail.py setup.cfg setup.py test_instafail.py pytest_instafail.egg-info/PKG-INFO pytest_instafail.egg-info/SOURCES.txt pytest_instafail.egg-info/dependency_links.txt pytest_instafail.egg-info/entry_points.txt pytest_instafail.egg-info/not-zip-safe pytest_instafail.egg-info/requires.txt pytest_instafail.egg-info/top_level.txt././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1592128049.0 pytest-instafail-0.4.2/pytest_instafail.egg-info/dependency_links.txt0000644000076500000240000000000100000000000026356 0ustar00jannestaff00000000000000 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1592128049.0 pytest-instafail-0.4.2/pytest_instafail.egg-info/entry_points.txt0000644000076500000240000000005100000000000025602 0ustar00jannestaff00000000000000[pytest11] instafail = pytest_instafail ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1573408697.0 pytest-instafail-0.4.2/pytest_instafail.egg-info/not-zip-safe0000644000076500000240000000000100000000000024536 0ustar00jannestaff00000000000000 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1592128049.0 pytest-instafail-0.4.2/pytest_instafail.egg-info/requires.txt0000644000076500000240000000001400000000000024703 0ustar00jannestaff00000000000000pytest>=2.9 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1592128049.0 pytest-instafail-0.4.2/pytest_instafail.egg-info/top_level.txt0000644000076500000240000000002100000000000025033 0ustar00jannestaff00000000000000pytest_instafail ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1592127714.0 pytest-instafail-0.4.2/pytest_instafail.py0000644000076500000240000000643300000000000021176 0ustar00jannestaff00000000000000# -*- coding: utf-8 -*- """ pytest_instafail ~~~~~~~~~~~~~~~~ pytest plugin to show failures instantly. :copyright: (c) 2013-2016 by Janne Vanhala. :license: BSD, see LICENSE for more details. """ import pytest from _pytest.terminal import TerminalReporter def pytest_addoption(parser): group = parser.getgroup("terminal reporting", "reporting", after="general") group._addoption( '--instafail', action="store_true", dest="instafail", default=False, help=( "show failures and errors instantly as they occur (disabled by " "default)." ) ) @pytest.mark.trylast def pytest_configure(config): if hasattr(config, 'workerinput'): return # xdist worker, we are already active on the master if config.option.instafail and config.pluginmanager.hasplugin('terminalreporter'): # Get the standard terminal reporter plugin... standard_reporter = config.pluginmanager.getplugin('terminalreporter') instafail_reporter = InstafailingTerminalReporter(standard_reporter) # ...and replace it with our own instafailing reporter. config.pluginmanager.unregister(standard_reporter) config.pluginmanager.register(instafail_reporter, 'terminalreporter') class InstafailingTerminalReporter(TerminalReporter): def __init__(self, reporter): TerminalReporter.__init__(self, reporter.config) self._tw = reporter._tw def pytest_collectreport(self, report): # Show errors occurred during the collection instantly. TerminalReporter.pytest_collectreport(self, report) if report.failed: if self.isatty: self.rewrite('') # erase the "collecting"/"collected" message self.print_failure(report) def pytest_runtest_logreport(self, report): # Show failures and errors occuring during running a test # instantly. TerminalReporter.pytest_runtest_logreport(self, report) if report.failed and not hasattr(report, 'wasxfail'): if self.verbosity <= 0: self._tw.line() self.print_failure(report) def summary_failures(self): # Prevent failure summary from being shown since we already # show the failure instantly after failure has occured. pass def summary_errors(self): # Prevent error summary from being shown since we already # show the error instantly after error has occured. pass def print_failure(self, report): if self.config.option.tbstyle != "no": if self.config.option.tbstyle == "line": line = self._getcrashline(report) self.write_line(line) else: msg = self._getfailureheadline(report) # "when" was unset before pytest 4.2 for collection errors. when = getattr(report, "when", "collect") if when == "collect": msg = "ERROR collecting " + msg elif when == "setup": msg = "ERROR at setup of " + msg elif when == "teardown": msg = "ERROR at teardown of " + msg self.write_sep("_", msg) if not self.config.getvalue("usepdb"): self._outrep_summary(report) ././@PaxHeader0000000000000000000000000000003300000000000011451 xustar000000000000000027 mtime=1592128049.131243 pytest-instafail-0.4.2/setup.cfg0000644000076500000240000000010300000000000017047 0ustar00jannestaff00000000000000[bdist_wheel] universal = 1 [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1592127852.0 pytest-instafail-0.4.2/setup.py0000644000076500000240000000267700000000000016762 0ustar00jannestaff00000000000000from setuptools import setup setup( name='pytest-instafail', description='pytest plugin to show failures instantly', long_description=open("README.rst").read(), version='0.4.2', url='https://github.com/pytest-dev/pytest-instafail', license='BSD', author='Janne Vanhala', author_email='janne.vanhala@gmail.com', py_modules=['pytest_instafail'], entry_points={'pytest11': ['instafail = pytest_instafail']}, zip_safe=False, include_package_data=True, platforms='any', install_requires=['pytest>=2.9'], python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Operating System :: Microsoft :: Windows', 'Operating System :: MacOS :: MacOS X', 'Topic :: Software Development :: Testing', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: PyPy', ] ) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1592127714.0 pytest-instafail-0.4.2/test_instafail.py0000644000076500000240000002167600000000000020633 0ustar00jannestaff00000000000000# -*- coding: utf-8 -*- pytest_plugins = "pytester" import pytest class Option(object): def __init__(self, verbose=False, quiet=False, n=None): self.verbose = verbose self.quiet = quiet self.n = None @property def args(self): l = ['--instafail'] if self.verbose: l.append('-v') if self.quiet: l.append('-q') if self.n is not None: self.args.extend(['-n', str(self.n)]) return l @pytest.fixture(params=['normal', '1 worker', '2 worker']) def n(request): return { 'normal': None, '1 worker': 1, '2 worker': 2, }[request.param] @pytest.fixture(params=['default', 'verbose', 'quiet']) def option(request, n): return { "default": Option(verbose=False, n=n), "verbose": Option(verbose=True, n=n), "quiet": Option(quiet=True, n=n), }[request.param] class TestInstafailingTerminalReporter(object): def test_fail(self, testdir, option): testdir.makepyfile( """ import pytest def test_func(): assert 0 """ ) result = testdir.runpytest(*option.args) if option.verbose: result.stdout.fnmatch_lines([ "*test_fail.py:*:*test_func*FAIL*", "* test_func *", " def test_func():", "> assert 0", "E assert 0", ]) elif option.quiet: result.stdout.fnmatch_lines([ "F", "* test_func *", " def test_func():", "> assert 0", "E assert 0", ]) else: result.stdout.fnmatch_lines([ "*test_fail.py F", "* test_func *", " def test_func():", "> assert 0", "E assert 0", ]) def test_fail_fail(self, testdir, option): testdir.makepyfile( """ import pytest def test_func(): assert 0 def test_func2(): assert 0 """ ) result = testdir.runpytest(*option.args) if option.verbose: result.stdout.fnmatch_lines([ "*test_fail_fail.py:*:*test_func*FAIL*", "* test_func *", " def test_func():", "> assert 0", "E assert 0", "test_fail_fail.py:3: AssertionError", "", "*test_fail_fail.py:*:*test_func2*FAIL*", "* test_func2 *", " def test_func2():", "> assert 0", "E assert 0", ]) elif option.quiet: result.stdout.fnmatch_lines([ "F", "* test_func *", " def test_func():", "> assert 0", "E assert 0", "F", "* test_func2 *", " def test_func2():", "> assert 0", "E assert 0", ]) else: result.stdout.fnmatch_lines([ "*test_fail_fail.py F", "* test_func *", " def test_func():", "> assert 0", "E assert 0", "*test_fail_fail.py F", "* test_func2 *", " def test_func2():", "> assert 0", "E assert 0", ]) def test_error_in_setup_then_pass(self, testdir, option): testdir.makepyfile( """ def setup_function(function): print ("setup func") if function is test_nada: assert 0 def test_nada(): pass def test_zip(): pass """ ) result = testdir.runpytest(*option.args) if option.verbose: result.stdout.fnmatch_lines([ "*test_error_in_setup_then_pass.py:*:*test_nada*ERROR*", "*ERROR at setup of test_nada*", "*setup_function(function):*", "*setup func*", "*assert 0*", "test_error_in_setup_then_pass.py:4: AssertionError", "", "*test_error_in_setup_then_pass.py:*:*test_zip*PASSED*", "*1 error*", ]) elif option.quiet: result.stdout.fnmatch_lines([ "E", "*ERROR at setup of test_nada*", "*setup_function(function):*", "*setup func*", "*assert 0*", "test_error_in_setup_then_pass.py:4: AssertionError", ".*", ]) else: result.stdout.fnmatch_lines([ "*test_error_in_setup_then_pass.py E", "*ERROR at setup of test_nada*", "*setup_function(function):*", "*setup func*", "*assert 0*", "test_error_in_setup_then_pass.py:4: AssertionError", "", "*test_error_in_setup_then_pass.py .*", "*1 error*", ]) assert result.ret != 0 def test_error_in_teardown_then_pass(self, testdir, option): testdir.makepyfile( """ def teardown_function(function): print ("teardown func") if function is test_nada: assert 0 def test_nada(): pass def test_zip(): pass """ ) result = testdir.runpytest(*option.args) if option.verbose: result.stdout.fnmatch_lines([ "*test_error_in_teardown_then_pass.py:*:*test_nada*ERROR*", "*ERROR at teardown of test_nada*", "*teardown_function(function):*", "*teardown func*", "*assert 0*", "test_error_in_teardown_then_pass.py:4: AssertionError", "", "*test_error_in_teardown_then_pass.py:*:*test_zip*PASSED*", "*1 error*", ]) elif option.quiet: result.stdout.fnmatch_lines([ ".E", "*ERROR at teardown of test_nada*", "*teardown_function(function):*", "*teardown func*", "*assert 0*", "test_error_in_teardown_then_pass.py:4: AssertionError", ".*", ]) else: result.stdout.fnmatch_lines([ "*test_error_in_teardown_then_pass.py .E", "*ERROR at teardown of test_nada*", "*teardown_function(function):*", "*teardown func*", "*assert 0*", "test_error_in_teardown_then_pass.py:4: AssertionError", "", "*test_error_in_teardown_then_pass.py .*", "*1 error*", ]) assert result.ret != 0 def test_collect_error(self, testdir, option): testdir.makepyfile("""raise ValueError(0)""") result = testdir.runpytest(*option.args) result.stdout.fnmatch_lines([ "*ERROR collecting test_collect_error.py*", "test_collect_error.py:1: in ", "* raise ValueError(0)", "E ValueError: 0", ]) if not option.quiet: result.stdout.fnmatch_lines([ "collected 0 items / 1 error*", ]) def test_print_stacktrace_once_with_pdb(self, testdir, request, option): test_file = testdir.makepyfile( """ def test_func(): assert 0 """ ) args = option.args args.append(" --pdb %s" % test_file) child = testdir.spawn_pytest(' '.join(args)) child.expect('>+ traceback >+') assert b'E assert 0' not in child.before child.expect('(Pdb)') child.sendeof() if child.isalive(): child.wait() def test_xfail_unexpected_success(self, testdir, option): testdir.makepyfile( """ import pytest @pytest.mark.xfail def test_func(): pass """ ) result = testdir.runpytest(*option.args) if option.verbose: result.stdout.fnmatch_lines([ "test_xfail_unexpected_success.py:*:*test_func XPASS*" ]) elif option.quiet: result.stdout.fnmatch_lines([ "X*" ]) else: result.stdout.fnmatch_lines([ "test_xfail_unexpected_success.py X*" ]) assert "INTERNALERROR" not in result.stdout.str()