Welcome to pytest-flake8 documentation!¶
py.test plugin to test with flake8.
- class pytest_flake8.Flake8File(*k, **kw)¶
Bases:
File- collect()¶
Collect children (items and collectors) for this collector.
- config: Config¶
The pytest config object.
- parent¶
The parent collector node.
- path: pathlib.Path¶
Filesystem path where this node was collected from (can be None).
- session: Session¶
The pytest session this node is part of.
- class pytest_flake8.Flake8Item(*k, **kw)¶
Bases:
Item- config: Config¶
The pytest config object.
- parent¶
The parent collector node.
- path: pathlib.Path¶
Filesystem path where this node was collected from (can be None).
- reportinfo()¶
Get location information for this item for test reports.
Returns a tuple with three elements:
The path of the test (default
self.path)The 0-based line number of the test (default
None)A name of the test to be shown (default
"")
See also
- repr_failure(excinfo)¶
Return a representation of a collection or test failure.
See also
- Parameters:
excinfo – Exception information for the failure.
- runtest()¶
Run the test case for this item.
Must be implemented by subclasses.
See also
- session: Session¶
The pytest session this node is part of.
- setup()¶
- pytest_flake8.check_file(path, flake8ignore, maxlength, maxdoclenght, maxcomplexity, showsource, statistics)¶
Run flake8 over a single file, and return the number of failures.
- pytest_flake8.pytest_addoption(parser)¶
Hook up additional options.
- pytest_flake8.pytest_collect_file(file_path, path, parent)¶
Filter files down to which ones should be checked.
- pytest_flake8.pytest_configure(config)¶
Start a new session.
- pytest_flake8.pytest_unconfigure(config)¶
Flush cache at end of run.