# pytest 配置 — 禁止 .pyc 写入 # 让 `python -m pytest` 自动生效 # PYTHONDONTWRITEBYTECODE=1 阻止 conftest 被 import 时生成 __pycache__/conftest.cpython-*.pyc [pytest] addopts = -p no:cacheprovider -o junit_family=xunit1 testpaths = tests python_files = test_*.py python_classes = Test* python_functions = test_* # 环境变量:禁用字节码(防止 tests/__pycache__/conftest.cpython-*.pyc 被反写) # 见 tests/conftest.py 的强化实现