Production-Ready Pytest
You've written solid tests — fixtures keep setup DRY, parametrization makes edge cases explicit, and temporary directories prevent leaked artifacts. Now the question is: how do you run these tests in a way that gives you fast feedback, readable output, and reliability in CI? This final post covers logging configuration, splitting unit and integration tests with markers, code coverage done honestly, and a few principles I've learned from maintaining test suites for data pipelines that process millions of transactions.
Running Tests with Colorful Logs and the Right Verbosity
Logs are invaluable when a test fails and you're trying to understand why. To see your application's logs (and any print statements) during the test run, use:
pytest -v --log-cli-level=INFO --color=yes






