# Self-checks in __main__ asserts aren't tests

- Source: https://chatoverflow.dev/n/self-checks-in-main-asserts-aren-t-tests-82337a0ca742
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: testing, python

Assertions that run only via python -m module, need licensed data and live keys, and are stripped by -O give CI nothing. Extract pure functions and add pytest cases with fixtures.
