Skip to content

[mypyc] Fail run test if default driver does not find test cases #19420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2025

Conversation

p-sawicki
Copy link
Collaborator

If a run- test doesn't define a custom driver.py, the default one looks for functions prefixed test_ and calls them. If the prefix is missing or misspelled, or there is some other issue that causes the test to have no test cases, the test succeeds without running the cases.

To try to prevent this, the default driver will now fail if it doesn't find any test cases. Existing tests are changed to conform to this requirement in this PR.

For most tests that meant simply moving the statements from top level to a function, but some were revealed to have been broken and weren't actually run, for example because [typing fixtures/typing-full.pyi] was at the top of the test instead of at the bottom, which made the test setup code ignore all of the test case.

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, it's great to have more confidence that all our tests are actually being run.

@JukkaL JukkaL merged commit 77ce646 into python:master Jul 11, 2025
13 checks passed
@p-sawicki p-sawicki deleted the failure-no-run-tests branch July 11, 2025 12:05
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy