Commit 330340a
authored
Fix test module imports (#277)
This commit modifies `top_level_dir`, which is used to resolve module names
when loading unittests, to ensure, only modules from specified ST package are
importet.
Without this commit, UnitTesting might attempt to import packages/modules/tests
from Lib/ directory due to possible ambiguities.
Scenario:
Plugins of `MyPackage` are organized in `Packages/MyPackage/dirname/` and tests
in `Packages/MyPackage/dirname/tests/`. If a library `Lib/pythonXX/dirname`
exists, Unittesting would have attempted to import tests from that directory,
because test module paths would have been translated to `dirname.tests` due to
`top_level_dir` pointing to `Packages/MyPackage`.
By adjusting `top_level_dir` to `Packages/`, test module names are translated
to `MyPackage.dirname.tests` instead.1 parent f8be6fb commit 330340a
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| |||
0 commit comments