Skip to content

Commit faca353

Browse files
committed
feat(python): add conftest.py
1 parent 2e814cf commit faca353

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
def pytest_addoption(parser):
2+
"""Add custom commands to pytest invocation.
3+
4+
See https://docs.pytest.org/en/8.1.x/reference/reference.html#parser"""
5+
parser.addoption(
6+
"--verbose-logs",
7+
action="store_true",
8+
default=False,
9+
help="show noisy module logs",
10+
)
11+
12+
13+
def pytest_configure(config):
14+
"""Configure pytest setup."""
15+
# add noisy logging libraries.
16+
if not config.getoption("--verbose-logs"):
17+
pass
18+
# for example:
19+
# logging.getLogger("botocore").setLevel(logging.ERROR)
20+
# logging.getLogger("boto3").setLevel(logging.ERROR)
21+
# logging.getLogger("urllib3.connectionpool").setLevel(logging.ERROR)

0 commit comments

Comments
 (0)