I have a package structure like this:
If I right-click on \myprogram\tests and choose "Run 'Unittests in tests'", they work. Great. But if I right-click on \myprogram and choose "Run 'Unittests in myprogram'", those same tests in \myprogram\tests now fail because they are no longer able to import files from their own package. eg. \myprogram\tests\test1.py can no longer import \myprogram\tests\test_helper.py.
A similar problem applies to \myprogram\subpackage\tests - if I choose that directory directly and run tests inside it, they work. If those tests are discovered by running from a parent directory, import errors happen.
This is both slightly inconvenient (as we not only have to run tests and integration_tests separately, but have to test each package and sub-package explicitly and individually) and ruins our coverage testing (because testing \myprogram will use code from subpackage, but won't have run the tests in subpackage\tests)
What can we do about this?
(Also, while I'm here, marking a folder as Excluded doesn't seem to exclude it from being found by 'Run Unit Tests In...' Bug, or feature?)