Skip to content
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

Clarification on how to Run .test Files? #17687

Closed
gnohgnailoug opened this issue Aug 19, 2024 · 6 comments
Closed

Clarification on how to Run .test Files? #17687

gnohgnailoug opened this issue Aug 19, 2024 · 6 comments
Labels
documentation topic-developer Issues relevant to mypy developers topic-tests

Comments

@gnohgnailoug
Copy link

Documentation

I'm familiar with running Python test files using commands like pytest test_xx.py and running unit test cases with pytest testXxxx. However, I am unclear about how to execute tests in files with the .test extension. We couldn't find any documentation related to this. Could you please provide guidance on the correct approach or command to run these .test files?

@AlexWaygood
Copy link
Member

There's some docs on how to run tests at https://github.com/python/mypy/blob/master/CONTRIBUTING.md#running-tests, and more detailed documentation at https://github.com/python/mypy/tree/master/test-data/unit#tests (which is linked to from the first link).

I think putting this information in CONTRIBUTING.md (where it currently is) is where most people would expect to find it. Did you look there? :-)

@AlexWaygood AlexWaygood added topic-developer Issues relevant to mypy developers topic-tests labels Aug 19, 2024
@gnohgnailoug
Copy link
Author

There's some docs on how to run tests at https://github.com/python/mypy/blob/master/CONTRIBUTING.md#running-tests, and more detailed documentation at https://github.com/python/mypy/tree/master/test-data/unit#tests (which is linked to from the first link).

I think putting this information in CONTRIBUTING.md (where it currently is) is where most people would expect to find it. Did you look there? :-)

Thank you, Alex. It seems that i miss some important information, i will try it later. You're so kind, hope you have a good day :)!

@AlexWaygood
Copy link
Member

hope you have a good day

you too!!

@gnohgnailoug
Copy link
Author

@AlexWaygood
Hi Alex,

I hope you're doing well! I have a follow-up question regarding .test files in the MyPy project. Specifically, how can we identify the corresponding test/test_xx.py file and the related test suite for a given .test file? For example, in the MyPy CONTRIBUTING.md example (pytest mypy/test/testcheck.py::TypeCheckSuite::check-dataclasses.test), how would we determine that check-dataclasses.test is linked to mypy/test/testcheck.py and TypeCheckSuite?

Thank you for your help!

@AlexWaygood
Copy link
Member

I believe you use the prefixes of the test files. E.g. all test files starting with check-* are executed by testcheck.py; all test files starting with semanal-* are executed by testsemanal.py, etc.

@gnohgnailoug
Copy link
Author

I believe you use the prefixes of the test files. E.g. all test files starting with check-* are executed by testcheck.py; all test files starting with semanal-* are executed by testsemanal.py, etc.

Oh, i got it! Thanks again :)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation topic-developer Issues relevant to mypy developers topic-tests
Projects
None yet
Development

No branches or pull requests

2 participants