Skip to content

Commit

Permalink
feat(python): add conftest.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jan 2, 2025
1 parent 2e814cf commit faca353
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions python/{{cookiecutter.project_slug}}/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
def pytest_addoption(parser):
"""Add custom commands to pytest invocation.
See https://docs.pytest.org/en/8.1.x/reference/reference.html#parser"""
parser.addoption(
"--verbose-logs",
action="store_true",
default=False,
help="show noisy module logs",
)


def pytest_configure(config):
"""Configure pytest setup."""
# add noisy logging libraries.
if not config.getoption("--verbose-logs"):
pass
# for example:
# logging.getLogger("botocore").setLevel(logging.ERROR)
# logging.getLogger("boto3").setLevel(logging.ERROR)
# logging.getLogger("urllib3.connectionpool").setLevel(logging.ERROR)

0 comments on commit faca353

Please sign in to comment.