nrunner: fix path when loading python unit tests
The current runner loader/discovery method is a custom build and finds modules/tests recursively on the current folder. With the new runner, part of the python unittest discover was delegated to 'loadTestsFromName()' on the standard library that uses a different logic for this (assumes that we need to import the test). Because of that we need 1) create a custom base loader here, or 2) prepend the path with the current dir so loadTestsFromName will return a valid test suite. This might not be the perfect solution but was a hot-fix found for LTS. Fixes #3851 Reference: https://docs.python.org/3/library/unittest.html#unittest.TestLoader.loadTestsFromNameSigned-off-by: NBeraldo Leal <bleal@redhat.com>
Showing
想要评论请 注册 或 登录