avocado.core.loader: Append test directory to sys.path
If a test has local imports (a fairly common use case), we have to append the base test dir to sys.path. Otherwise, we end up having a horrible traceback as a result: Exception loading test Traceback (most recent call last): File "/home/lmr/Code/avocado.lmr/avocado/core/runner.py", line 200, in _run_test instance = loader.load_test(test_factory) File "/home/lmr/Code/avocado.lmr/avocado/core/loader.py", line 262, in load_test test_module = imp.load_module(module_name, f, p, d) File "scylla_longevity.py", line 5, in <module> from sdcm.tester import ScyllaClusterTester ImportError: No module named sdcm.tester Which is clearly not wanted. We had this problem before and now we have a regression. It's time for a functional test to make sure we don't regress again. Signed-off-by: NLucas Meneghel Rodrigues <lookkas@gmail.com> Signed-off-by: NCleber Rosa <crosa@redhat.com>
Showing
想要评论请 注册 或 登录