Skip to content

Fix pytest collection warnings for Test-prefixed model/class names - #11

Merged
anonymousAAK merged 1 commit into
anonymousAAK:masterfrom
champ18ion:fix/test-result-collection-warning
Jun 14, 2026
Merged

Fix pytest collection warnings for Test-prefixed model/class names#11
anonymousAAK merged 1 commit into
anonymousAAK:masterfrom
champ18ion:fix/test-result-collection-warning

Conversation

@champ18ion

Copy link
Copy Markdown
Contributor

Closes #10

TestResult (src/aastf/models/result.py) and TestPrioritizer
(src/aastf/cost_scheduler.py) are not test classes, but pytest tries
to collect them because their names start with Test, emitting a
collection warning for every test module that imports them (9 warnings
total in the current suite).

Adding __test__ = False to both classes tells pytest to skip them.

Verified:

  • pytest -q: 2960 passed, 2 skipped, 0 warnings (was 9 warnings before)
  • mypy: clean
  • ruff: clean

TestResult and TestPrioritizer are not test classes but pytest tries
to collect them because of the Test prefix, emitting a warning for
every test module that imports them. Mark both with __test__ = False.
@champ18ion
champ18ion requested a review from anonymousAAK as a code owner June 11, 2026 17:22
@anonymousAAK
anonymousAAK merged commit 01d13b6 into anonymousAAK:master Jun 14, 2026
10 checks passed
@champ18ion
champ18ion deleted the fix/test-result-collection-warning branch June 18, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] TestResult and TestPrioritizer trigger pytest collection warnings

2 participants