Skip to main content

Ignore some loggers' log for pytest

Project description

pytest-log-filter

Languate - Python PyPI - License PyPI PyPI - Downloads

屏蔽pytest测试中指定loggers的日志


如何使用

  1. 安装 pytest-log-filter

使用pip安装

pip install pytest-log-filter
  1. 在pytest命令行参数使用--log-ignore指定要屏蔽的logger模块
pytest . --log-ignore=urllib3.connectionpool --log-ignore=web3.manager.RequestManager

或在pytest.ini中配置

[pytest]
log_ignore =
    web3.providers.HTTPProvider
    web3._utils.http_session_manager.HTTPSessionManager

同时使用命令行参数--log-ignore和pytest-ini配置,会屏蔽所有的loggers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_log_filter-0.0.2.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file pytest_log_filter-0.0.2.tar.gz.

File metadata

  • Download URL: pytest_log_filter-0.0.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for pytest_log_filter-0.0.2.tar.gz
Algorithm Hash digest
SHA256 37e7947c226919708b8f138423da2ba47c62f3f26d8ed1f3b11eb6bd5ecd7ee5
MD5 62ad5142f6a1bcdc14b80434a82ec351
BLAKE2b-256 4cedca9eee8b980d942a75ea7594e7c03e60184736f151056aeeb39bc9daa04c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page