You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many of our projects make use of AWS and database connection libraries that are VERY verbose on debug logging. This can make it hard to get actually meaningful logs in testing. In a couple of our libraries, we have an option to disable those noisy logs -- the template should optionally include a stub for that.
Use case
make logs readable but enable connection debugging if necessary
Proposed solution
blank version of this
def pytest_addoption(parser):
"""Add custom commands to pytest invocation.
See https://docs.pytest.org/en/7.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."""
logging.getLogger(__name__).error(config.getoption("--verbose-logs"))
if not config.getoption("--verbose-logs"):
for lib in (
"botocore",
"boto3",
"urllib3.connectionpool",
"neo4j.pool",
"neo4j.io",
):
logging.getLogger(lib).setLevel(logging.ERROR)
Alternatives considered
No response
Implementation details
No response
Potential Impact
No response
Additional context
No response
Contribution
Yes, I can create a PR for this feature.
The text was updated successfully, but these errors were encountered:
Feature description
Many of our projects make use of AWS and database connection libraries that are VERY verbose on debug logging. This can make it hard to get actually meaningful logs in testing. In a couple of our libraries, we have an option to disable those noisy logs -- the template should optionally include a stub for that.
Use case
make logs readable but enable connection debugging if necessary
Proposed solution
blank version of this
Alternatives considered
No response
Implementation details
No response
Potential Impact
No response
Additional context
No response
Contribution
Yes, I can create a PR for this feature.
The text was updated successfully, but these errors were encountered: