micropython-lib/python-stdlib/unittest-discover
Andrew Leech 50ac49c42b unittest-discover: Avoid adding test parent dir to sys.path.
When running tests from subfolders, import by "full dotted path" rather
than just module name, removing the need to add the test parent folder to
`sys.path`.

This matches CPython more closely, which places `abspath(top)` at the start
of `sys.path` but doesn't include the test file parent dir at all.

It fixes issues where projects may include a `test_xxx.py` file in their
distribution which would (prior to this change) be unintentionally found by
unittest-discover.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2024-07-03 16:53:49 +10:00
..
tests unittest-discover: Avoid adding test parent dir to sys.path. 2024-07-03 16:53:49 +10:00
unittest unittest-discover: Avoid adding test parent dir to sys.path. 2024-07-03 16:53:49 +10:00
manifest.py unittest-discover: Avoid adding test parent dir to sys.path. 2024-07-03 16:53:49 +10:00