提交 42875fa7 编写于 作者: C Cleber Rosa

selftests/unit/test_loader.py: use utility method _check_discovery()

Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 00200581
...@@ -503,12 +503,7 @@ class LoaderTest(unittest.TestCase): ...@@ -503,12 +503,7 @@ class LoaderTest(unittest.TestCase):
('DiscoverMe2', 'selftests/.data/loader_instrumented/dont_crash.py:DiscoverMe2.test'), ('DiscoverMe2', 'selftests/.data/loader_instrumented/dont_crash.py:DiscoverMe2.test'),
('DiscoverMe3', 'selftests/.data/loader_instrumented/dont_crash.py:DiscoverMe3.test'), ('DiscoverMe3', 'selftests/.data/loader_instrumented/dont_crash.py:DiscoverMe3.test'),
('DiscoverMe4', 'selftests/.data/loader_instrumented/dont_crash.py:DiscoverMe4.test')] ('DiscoverMe4', 'selftests/.data/loader_instrumented/dont_crash.py:DiscoverMe4.test')]
for exp, tst in zip(exps, tests): self._check_discovery(exps, tests)
# Test class
self.assertEqual(tst[0], exp[0])
# Test name (path)
# py2 reports relpath, py3 abspath
self.assertEqual(os.path.abspath(tst[1]['name']), os.path.abspath(exp[1]))
def test_double_import(self): def test_double_import(self):
path = os.path.join(os.path.dirname(os.path.dirname(__file__)), path = os.path.join(os.path.dirname(os.path.dirname(__file__)),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册