-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Auto-discovery of .test files #8650
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
Comments
I am interested in looking into this, as I was a bit surprised that the
One would expect one (or a couple extended) classes(s) to parse all the tests and generate a recognizable pytest output. It's going to require a bit more understanding on my side, although I gained some experience through #8524 and @ethanhs his work in #8571. So just for clarity's sake:
|
@JukkaL it'd be awesome to hear your thoughts so I can get to work. Just a 'go-ahead' is fine for now. |
I will work on this, although any comment would be great. @ethanhs do you have any thoughts? It isn't a small endeavor this time, but pretty similar to data-driven tests like we worked on earlier |
I'm afraid I'm not sure the particulars of what @JukkaL has in mind, so it'd be best to ask him. |
@JukkaL I'd gladly hear about whether this issue can be acted upon |
I'd like to work on this issue. |
Hello Sir , I was trying to fix auto-discovery of .test files #8650 Here is the script
But there was path not found error. Can you exactly tell me from where would it be called ?
So is that the default location from where we can call it ? If yes ,then maybe this would work :
Please Help !! |
Replaced the hardcoded list of test data files by an automatic discovery system that uses a glob expression on `check-*.test`. Fixes python#8650.
This PR hopefully resolves #8650. The main change is the `find_test_files ` helper function that looks for files matching the pattern in the unit tests directory. It has been used in the following test files for autodiscovery: - `testcheck.py` - `testdeps.py` - ` testfinegrained.py` - `testparse.py` - `testsemanal.py` I've also updated the readme.
Currently all the
.test
files (used for mypy self tests) are enumerated in the test case runners, such as inmypy/test/testcheck.py
. This is error-prone and can be confusing.It would be better to do auto-discovery of test files using file name prefixes. For example, all the files with names like
check-*.test
would be executed bymypy.test.testcheck
.(Additionally, if there is an unrecognized
.test
file, it would be nice to generate an error and give hints about how to fix the issue. Addressing this is optional for now, however, and may be a bit tricky.)The text was updated successfully, but these errors were encountered: