Name Description Size
_py
acceptance_test.py def pytest_sessionstart(): 0 / 0 50573
code
conftest.py Restore tracing function (when run with Coverage.py). https://bugs.python.org/issue37011 7653
deprecated_test.py 6883
example_scripts
examples
freeze
io
logging
plugins_integration
python
test_argcomplete.py File completer class, optionally takes a list of allowed extensions. 3205
test_assertion.py Test that conftest files are using assertion rewrite on import (#1619). 65668
test_assertrewrite.py Rewrite the assertions in f, run it, and get the failure message. 66826
test_cacheprovider.py The .pytest_cache directory should have world-readable permissions (depending on umask). Regression test for #12308. 46622
test_capture.py \ # taken from issue 227 from nosetests def test_unicode(): import sys print(sys.stdout) print(%s) 52300
test_collection.py Ensure that file exists 66504
test_compat.py Check that get_real_func correctly unwraps decorators until reaching the real function 6569
test_config.py \ [{section}] name = value 79557
test_conftest.py 25188
test_debugging.py def test_func(): assert 0 42765
test_doctest.py # This is a function # >>> # it doesn't have any doctest 50626
test_entry_points.py 279
test_error_diffs.py Tests and examples for correct "+/-" usage in error diffs. See https://github.com/pytest-dev/pytest/issues/3333 for details. 8247
test_faulthandler.py Test single crashing test displays a traceback. 5151
test_findpaths.py pytest.ini files are always considered for configuration, even if empty 5926
test_helpconfig.py Regression check for the public version attributes in pytest. 4148
test_junitxml.py Return an xmlschema.XMLSchema object for the junit-10.xsd file. 57759
test_legacypath.py Check test_tmproot is a py.path attribute for backward compatibility. 5854
test_link_resolve.py See: https://github.com/pytest-dev/pytest/issues/5965. 2343
test_main.py import pytest def pytest_sessionstart(): raise {exc.__name__}("boom") def pytest_internalerror(excrepr, excinfo): returncode = {returncode!r} if returncode is not False: pytest.exit("exiting after %s..." % excinfo.typename, returncode={returncode!r}) 10824
test_mark.py Test fails file is run twice that contains marked class. See issue#683. 34611
test_mark_expression.py When generating nodeids, if the source name contains special characters like a newline, they are escaped into two characters like \n. Therefore, a user will never need to insert a literal newline, only \n (two chars). So mark expressions themselves do not support escaping, instead they treat backslashes as regular identifier characters. 5448
test_meta.py Test importing of all internal packages and modules. This ensures all internal packages can be imported without needing the pytest namespace being set, which is critical for the initialization of xdist. 781
test_monkeypatch.py 12801
test_nodes.py Verifies we warn on diamond inheritance as well as correctly managing legacy inheritance constructors with missing args as found in plugins. 4520
test_parseopt.py Custom prog can be set for `argparse.ArgumentParser`. 14830
test_pastebin.py import pytest def test_pass() -> None: pass def test_fail(): assert 0 def test_skip(): pytest.skip("") 6298
test_pathlib.py Fixture to make pytester() being autouse for all tests in this module. pytester makes sure to restore sys.path to its previous state, and many tests in this module import modules and change sys.path because of that, so common module names such as "test" or "test.conftest" end up leaking to tests in other modules. Note: we might consider extracting the sys.path restoration aspect into its own fixture, and apply it to the entire test suite always. 56196
test_pluginmanager.py def pytest_myhook(xyz): "new hook" 17285
test_pytester.py >>> import os >>> pytester = getfixture("pytester") >>> str(pytester.makepyfile("content")).replace(os.sep, '/') '.../basetemp/sub.t-doctest0/sub.py' 27327
test_python_path.py from foo import foo def test_foo(): assert foo() == 1 3480
test_recwarn.py import warnings def test_method(recwarn): warnings.warn("hello") warn = recwarn.pop() assert isinstance(warn.message, UserWarning) 22002
test_reports.py Regarding issue pytest-xdist#241. This test came originally from test_remote.py in xdist (ca03269). 19994
test_runner.py def setup_module(mod): raise ValueError(42) def test_func(): pass 37684
test_runner_xunit.py Test correct setup/teardowns at module, class, and instance level. 7846
test_scope.py 1346
test_session.py def test_one(): pass def test_one_one(): assert 0 def test_other(): raise ValueError(23) class TestClass(object): def test_two(self, someargs): pass 15424
test_setuponly.py import pytest @pytest.fixture def _arg0(): """hidden arg0 fixture""" @pytest.fixture def arg1(): """arg1 docstring""" def test_arg1(arg1): pass 8188
test_setupplan.py Verify that fixtures are not executed. 3498
test_skipping.py import pytest @pytest.mark.xfail def test_func(): pass 43967
test_stash.py 1840
test_stepwise.py def pytest_addoption(parser): group = parser.getgroup('general') group.addoption('--fail', action='store_true', dest='fail') group.addoption('--fail-last', action='store_true', dest='fail_last') 10633
test_terminal.py Terminal reporting of the full testing process. 99735
test_threadexception.py import threading def test_it(): def oops(): raise ValueError("Oops") t = threading.Thread(target=oops, name="MyThread") t.start() t.join() def test_2(): pass 3956
test_tmpdir.py #4425 19532
test_unittest.py import unittest class MyTestCase(unittest.TestCase): def testpassing(self): self.assertEqual('foo', 'foo') def test_failing(self): self.assertEqual('foo', 'bar') 48425
test_unraisableexception.py class BrokenDel: def __del__(self): raise ValueError("del is broken") def test_it(): obj = BrokenDel() del obj def test_2(): pass 4141
test_warning_types.py Make sure all warnings declared in _pytest.warning_types are displayed as coming from 'pytest' instead of the internal module (#5452). 1476
test_warnings.py Create a test file which calls a function in a module which generates warnings. 27546
typing_checks.py File for checking typing issues. This file is not executed, it is only checked by mypy to ensure that none of the code triggers any mypy errors. 1215