We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e814cf commit faca353Copy full SHA for faca353
python/{{cookiecutter.project_slug}}/tests/conftest.py
@@ -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