forked from fecgov/fec-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
28 lines (22 loc) · 781 Bytes
/
conftest.py
File metadata and controls
28 lines (22 loc) · 781 Bytes
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
import logging
def pytest_addoption(parser):
parser.addoption(
"--no-linting",
action="store_true",
default=False,
help="Skip linting checks",
)
parser.addoption(
"--linting",
action="store_true",
default=False,
help="Only run linting checks",
)
def pytest_collection_modifyitems(session, config, items):
if config.getoption("--no-linting"):
items[:] = [item for item in items if not item.get_closest_marker('flake8')]
if config.getoption("--linting"):
items[:] = [item for item in items if item.get_closest_marker('flake8')]
def pytest_configure(config):
"""Flake8 is very verbose by default. Silence it."""
logging.getLogger("flake8").setLevel(logging.WARNING)