Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pytest-dev/pytest
/ functions
Functions
4,602 in github.com/pytest-dev/pytest
⨍
Functions
4,602
◇
Types & classes
572
↳
Endpoints
16
↓ 13 callers
Method
write_sep
( self, sep: str, title: Optional[str] = None, fullwidth: Optional[int] = None
src/_pytest/terminal.py:443
↓ 12 callers
Method
addfinalizer
Register a function to be called when this node is finalized. This method can only be called when this node is active in a setup chai
src/_pytest/nodes.py:409
↓ 12 callers
Function
determine_setup
( inifile: Optional[str], args: Sequence[str], rootdir_cmd_arg: Optional[str] = None, config:
src/_pytest/config/findpaths.py:170
↓ 12 callers
Method
from_function
(cls, obj: object)
src/_pytest/_code/code.py:69
↓ 12 callers
Method
get
(self, key)
testing/test_tmpdir.py:42
↓ 12 callers
Function
load_config_dict_from_file
Load pytest configuration from the given file path, if supported. Return None if the file does not contain valid pytest configuration.
src/_pytest/config/findpaths.py:35
↓ 12 callers
Method
parseoutcomes
Return a dictionary of outcome noun -> count from parsing the terminal output that the test process produced. The returned nouns will
src/_pytest/pytester.py:555
↓ 12 callers
Method
trace
(self)
testing/test_tmpdir.py:39
↓ 11 callers
Method
_from_json
Create either a TestReport or CollectReport, depending on the calling class. It is the callers responsibility to know which class to pass her
src/_pytest/reports.py:216
↓ 11 callers
Method
fnmatch_lines_random
Check lines exist in the output in any order (using :func:`python:fnmatch.fnmatch`).
src/_pytest/pytester.py:1554
↓ 11 callers
Method
from_parent
(cls, parent, *, name, x)
testing/test_collection.py:1397
↓ 11 callers
Method
getfailedcollections
(self)
src/_pytest/pytester.py:416
↓ 11 callers
Function
getfuncargnames
Return the names of a function's mandatory arguments. Should return the names of all function arguments that: * Aren't bound to an instance o
src/_pytest/compat.py:119
↓ 11 callers
Method
getparent
Get the next parent node (including self) which is an instance of the given class.
src/_pytest/nodes.py:417
↓ 11 callers
Method
listchain
Return list of all parent collectors up to self, starting from the root of collection tree.
src/_pytest/nodes.py:327
↓ 11 callers
Method
set
Save value for the given key. :param key: Must be a ``/`` separated value. Usually the first name is the name of your
src/_pytest/cacheprovider.py:165
↓ 11 callers
Method
syspath_prepend
Prepend ``path`` to ``sys.path`` list of import locations.
src/_pytest/monkeypatch.py:313
↓ 10 callers
Method
_addoption
(self, *optnames: str, **attrs: Any)
src/_pytest/config/argparsing.py:373
↓ 10 callers
Method
context
Context manager that returns a new :class:`MonkeyPatch` object which undoes any patching done inside the ``with`` block upon exit. Ex
src/_pytest/monkeypatch.py:133
↓ 10 callers
Function
evaluate_skip_marks
Evaluate skip and skipif marks on item, returning Skip if triggered.
src/_pytest/skipping.py:167
↓ 10 callers
Method
filter
Ignore warnings about missing include with "only" directive. Ref: https://github.com/sphinx-doc/sphinx/issues/2150.
doc/en/conf.py:407
↓ 10 callers
Function
get_real_func
Get the real function object of the (possibly) wrapped object by functools.wraps or functools.partial.
src/_pytest/compat.py:267
↓ 10 callers
Method
set_when
(self, when: str)
src/_pytest/logging.py:826
↓ 10 callers
Method
setdefault
Return the value of key if already set, otherwise set the value of key to default and return default.
src/_pytest/stash.py:90
↓ 10 callers
Method
setup
(self)
src/_pytest/nodes.py:321
↓ 10 callers
Method
suspend_global_capture
(self, in_: bool = False)
src/_pytest/capture.py:676
↓ 10 callers
Method
time
(self)
testing/conftest.py:204
↓ 9 callers
Method
_getconftestmodules
( self, path: Path, importmode: Union[str, ImportMode], rootpath: Path )
src/_pytest/config/__init__.py:541
↓ 9 callers
Function
bin_xml_escape
r"""Visually escape invalid XML characters. For example, transforms 'hello\aworld\b' into 'hello#x07world#x08' Note that
src/_pytest/junitxml.py:40
↓ 9 callers
Method
done
Stop capturing, restore streams, return original capture file, seeked to position zero.
src/_pytest/capture.py:405
↓ 9 callers
Function
ensure_file
Ensure that file exists
testing/test_collection.py:21
↓ 9 callers
Function
fnmatch_ex
A port of FNMatcher from py.path.common which works with PurePath() instances. The difference between this algorithm and PurePath.match() is that
src/_pytest/pathlib.py:388
↓ 9 callers
Function
getfslineno
Return source location (path, lineno) for the given object. If the source cannot be determined return ("", -1). The line number is 0-based.
src/_pytest/_code/code.py:1202
↓ 9 callers
Method
start
Start capturing on targetfd using memorized tmpfile.
src/_pytest/capture.py:390
↓ 9 callers
Method
stop_capturing
Stop capturing and reset capturing streams.
src/_pytest/capture.py:579
↓ 9 callers
Function
symlink_or_skip
Make a symlink, or skip the test in case symlinks are not supported.
src/_pytest/pathlib.py:429
↓ 9 callers
Method
write
(self, content: str, *, flush: bool = False, **markup: bool)
src/_pytest/terminal.py:413
↓ 8 callers
Method
_assert_state
(self, op: str, states: Tuple[str, ...])
src/_pytest/capture.py:383
↓ 8 callers
Method
_ensure_unconfigure
(self)
src/_pytest/config/__init__.py:994
↓ 8 callers
Method
add_cleanup
Add a function to be called when the config object gets out of use (usually coinciding with pytest_unconfigure).
src/_pytest/config/__init__.py:982
↓ 8 callers
Function
f
()
testing/test_runner.py:701
↓ 8 callers
Method
find_spec
( self, name: str, path: Optional[Sequence[Union[str, bytes]]] = None, target:
src/_pytest/assertion/rewrite.py:83
↓ 8 callers
Method
from_config
(cls, config: Config)
src/_pytest/main.py:484
↓ 8 callers
Method
from_exc_info
Return an ExceptionInfo for an existing exc_info tuple. .. warning:: Experimental API :param exprinfo: A te
src/_pytest/_code/code.py:469
↓ 8 callers
Function
g
(arg)
testing/python/fixtures.py:25
↓ 8 callers
Method
getbasetemp
Return the base temporary directory, creating it if needed.
src/_pytest/tmpdir.py:102
↓ 8 callers
Method
getfixturevalue
Dynamically run a named fixture function. Declaring fixtures via function argument is recommended where possible. But if you can only
src/_pytest/fixtures.py:580
↓ 8 callers
Method
import_plugin
Import a plugin with ``modname``. If ``consider_entry_points`` is True, entry point names are also considered to find a plugin.
src/_pytest/config/__init__.py:718
↓ 8 callers
Method
mktemp
Create a new temporary directory managed by the factory. :param basename: Directory base name, must be a relative path.
src/_pytest/tmpdir.py:78
↓ 8 callers
Method
perform_collect
( self, args: Optional[Sequence[str]] = ..., genitems: "Literal[True]" = ... )
src/_pytest/main.py:592
↓ 8 callers
Method
read
(self, *args)
src/_pytest/capture.py:191
↓ 8 callers
Method
runpython
Run a python script using sys.executable as interpreter.
src/_pytest/pytester.py:1440
↓ 8 callers
Method
teardown_exact
Teardown the current stack up until reaching nodes that nextitem also descends from. When nextitem is None (meaning we're at the last
src/_pytest/runner.py:513
↓ 7 callers
Function
_idval
( val: object, argname: str, idx: int, idfn: Optional[Callable[[Any], Optional[object]]],
src/_pytest/python.py:1363
↓ 7 callers
Method
addinivalue_line
Add a line to an ini-file option. The option must have been declared but might not yet be set in which case the line becomes the first
src/_pytest/config/__init__.py:1361
↓ 7 callers
Function
assert_never
(value: "NoReturn")
src/_pytest/compat.py:416
↓ 7 callers
Method
consider_preparse
:meta private:
src/_pytest/config/__init__.py:649
↓ 7 callers
Method
dumps
(self, obj)
doc/en/example/multipython.py:32
↓ 7 callers
Function
evaluate
(input: str, matcher: Callable[[str], bool])
testing/test_mark_expression.py:8
↓ 7 callers
Method
exconly
Return the exception as a string. When 'tryshort' resolves to True, and the exception is an AssertionError, only the actual exception
src/_pytest/_code/code.py:577
↓ 7 callers
Method
flush
(self)
src/_pytest/terminal.py:416
↓ 7 callers
Method
get_write_msg
(self, idx)
testing/conftest.py:96
↓ 7 callers
Method
getlines
()
testing/io/test_terminalwriter.py:75
↓ 7 callers
Method
getsource
Return failing source code.
src/_pytest/_code/code.py:244
↓ 7 callers
Function
make_numbered_dir
Create a directory with an increased number as suffix for the given prefix.
src/_pytest/pathlib.py:209
↓ 7 callers
Method
reportinfo
Get location information for this item for test reports. Returns a tuple with three elements: - The path of the test (default ``self
src/_pytest/nodes.py:726
↓ 7 callers
Method
repr_traceback_entry
( self, entry: TracebackEntry, excinfo: Optional[ExceptionInfo[BaseException]] = None,
src/_pytest/_code/code.py:802
↓ 7 callers
Method
set_level
Set the level of a logger for the duration of a test. .. versionchanged:: 3.4 The levels of the loggers changed by this function
src/_pytest/logging.py:441
↓ 6 callers
Method
_assert_state
(self, op: str, states: Tuple[str, ...])
src/_pytest/capture.py:262
↓ 6 callers
Method
_do_configure
(self)
src/_pytest/config/__init__.py:987
↓ 6 callers
Method
_importconftest
( self, conftestpath: Path, importmode: Union[str, ImportMode], rootpath: Path )
src/_pytest/config/__init__.py:585
↓ 6 callers
Method
assign
Give *expr* a name.
src/_pytest/assertion/rewrite.py:774
↓ 6 callers
Function
check_call
(*args, **kwargs)
testing/test_unittest.py:1182
↓ 6 callers
Method
clear
(self)
src/_pytest/pytester.py:458
↓ 6 callers
Method
collect
(self)
testing/example_scripts/fixtures/custom_item/conftest.py:10
↓ 6 callers
Function
conftest_setinitial
( conftest: PytestPluginManager, args, confcutdir: Optional["os.PathLike[str]"] = None )
testing/test_conftest.py:26
↓ 6 callers
Function
create_cleanup_lock
Create a lock to prevent premature folder cleanup.
src/_pytest/pathlib.py:230
↓ 6 callers
Method
delattr
Delete attribute ``name`` from ``target``. If no ``name`` is specified and ``target`` is a string it will be interpreted as a dotted
src/_pytest/monkeypatch.py:226
↓ 6 callers
Method
explanation_param
Return a new named %-formatting placeholder for expr. This creates a %-formatting placeholder for expr in the current formatting cont
src/_pytest/assertion/rewrite.py:795
↓ 6 callers
Function
f
()
testing/code/test_excinfo.py:60
↓ 6 callers
Method
fileno
(self)
src/_pytest/capture.py:203
↓ 6 callers
Method
filter
Return a Traceback instance with certain items removed fn is a function that gets a single argument, a TracebackEntry instance, and s
src/_pytest/_code/code.py:397
↓ 6 callers
Method
foo
()
testing/python/fixtures.py:3624
↓ 6 callers
Method
format_for_fnmatch
Replace color names for use with LineMatcher.fnmatch_lines
testing/conftest.py:169
↓ 6 callers
Function
func
()
src/_pytest/doctest.py:571
↓ 6 callers
Method
gethookproxy
(self, fspath: "os.PathLike[str]")
src/_pytest/main.py:533
↓ 6 callers
Method
getstatementrange
Return (start, end) tuple which spans the minimal statement region which containing the given lineno.
src/_pytest/_code/source.py:96
↓ 6 callers
Method
makepyprojecttoml
Write a pyproject.toml file with 'source' as contents. .. versionadded:: 6.0
src/_pytest/pytester.py:845
↓ 6 callers
Method
parse_args
Allow splitting of positional arguments.
src/_pytest/config/argparsing.py:417
↓ 6 callers
Method
pytest_sessionfinish
(self)
src/_pytest/junitxml.py:643
↓ 6 callers
Method
pytest_sessionstart
(self)
src/_pytest/junitxml.py:640
↓ 6 callers
Method
read_global_capture
(self)
src/_pytest/capture.py:689
↓ 6 callers
Method
repr_traceback
(self, excinfo: ExceptionInfo[BaseException])
src/_pytest/_code/code.py:848
↓ 6 callers
Function
resolve_collection_argument
Parse path arguments optionally containing selection parts and return (fspath, names). Command-line arguments can point to files and/or directori
src/_pytest/main.py:849
↓ 6 callers
Method
restore
(self)
src/_pytest/pytester.py:638
↓ 6 callers
Method
resume_global_capture
(self)
src/_pytest/capture.py:670
↓ 6 callers
Function
rm_rf
Remove the path contents recursively, even if some elements are read-only.
src/_pytest/pathlib.py:147
↓ 6 callers
Function
runtestprotocol
( item: Item, log: bool = True, nextitem: Optional[Item] = None )
src/_pytest/runner.py:118
↓ 6 callers
Function
safe_getattr
Like getattr but return default upon any Exception or any OutcomeException. Attribute access can potentially fail for 'evil' Python objects.
src/_pytest/compat.py:317
↓ 6 callers
Method
start_capturing
(self)
src/_pytest/capture.py:541
← previous
next →
101–200 of 4,602, ranked by callers