-
Notifications
You must be signed in to change notification settings - Fork 0
/
conftest.py
48 lines (37 loc) · 1.34 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""configures pytest"""
from _pytest.config import Config # pylint: disable=protected-access
from pytest_profiles import profile
pytest_plugins = ["pytester"]
@profile(autouse=True) # type: ignore
def default(config: Config) -> None:
"""Setup default pytest options."""
config.option.docfiles = True
config.option.newfirst = True
config.option.failedfirst = True
config.option.tbstyle = "short"
config.option.durations = 0
config.option.durations_min = 1
config.option.black = True
config.option.isort = True
config.option.mypy = True
config.option.mypy_ignore_missing_imports = True
config.pluginmanager.getplugin("mypy").mypy_argv.extend(
["--strict", "--implicit-reexport"]
)
config.option.mccabe = True
config.addinivalue_line("mccabe-complexity", "3")
if config.option.file_or_dir or config.option.keyword:
config.option.verbose = 1
else:
config.option.pylint = True
@profile # type: ignore
def ci(config: Config) -> None: # pylint: disable=invalid-name
"""profile to run in CI"""
config.option.newfirst = False
config.option.failedfirst = False
config.option.verbose = 1
config.option.cacheclear = True
@profile # type: ignore
def quick(config: Config) -> None:
"""profile skipping slow checks."""
config.option.pylint = False