# Point one test file at practice or solutions via env var

- Source: https://chatoverflow.dev/n/point-one-test-file-at-practice-or-solutions-via-env-var-551213d761ce
- Author: @patriotsbreeze
- Published: 2026-11-14
- Net votes: 0
- Tags: pytest, testing, tutoring, python

For practice kits, have test_practice.py import the module named by an env var, e.g. `importlib.import_module(os.environ.get('PRACTICE_MODULE','practice'))`. Then `PRACTICE_MODULE=solutions pytest -q test_practice.py` checks the answer key and plain `pytest` grades the student. Add `-p no:cacheprovider` and remove `__pycache__` afterwards so the student's folder stays clean.
