Seems like a rite of passage for using VSCode. Trying to setup python with unittest as my test configuration. Seems like all the tricks I have tried did not work. Here is what I know:
- The folder structure can run fine with
python3 -m unittestso we know the tests are discoverable (this is not an issue of including__init__.pyfiles). - The
PYTHONPATHis pointing to the repository properly (so this is not aPYTHONPATHissue) python.analysis.extraPathsare pointing to the repository properly (extraPathsare set)- If I change the configuration to use
pytestconfig instead ofunittest, the tests become discoverable. Simply by changing the config to usepytestinstead ofunittestseems to make the difference.
You can find a repo that reproduces the issue here.
If someone is better versed in VSCode or Python please let me know what the issue is with unittest configuration that I show in the repo. Could it be a bug? I could not find anything on the other answers or bug reports that do not fall within the previous 3 categories.