Skip to content

Commit

Permalink
feat: add ut
Browse files Browse the repository at this point in the history
  • Loading branch information
Ming5024 authored and alexwjxie committed Jul 21, 2023
1 parent a5359ea commit ba2b7e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions testbase/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ def _load_from_module(
)
tests.append(obj(testcases))

print(mod)

if hasattr(mod, "__qtaf_seq_tests__"): # 测试用例需要顺序执行
seqdef = mod.__qtaf_seq_tests__
if not isinstance(seqdef, list):
Expand Down
8 changes: 8 additions & 0 deletions tests/test_testbase/test_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ def test_bad_name_reversible(self):
new_tests = loader.load(test_set)
self.assertEqual(len(new_tests), len(tests))

def test_bad_name_reversible(self):
tests = self.loader.load("tests.sampletest.seqtest.SeqTestSuiteTest")
tests_by_file = self.loader.load("tests.sampletest.seqtest")
from testbase.testsuite import SeqTestSuite
self.assertEqual(type(tests[0]), SeqTestSuite)
self.assertEqual(tests[0].test_class_name, tests_by_file[0].test_class_name)



if __name__ == "__main__":
# unittest.main(defaultTest="LoadDataDriveReversibleTest")
Expand Down

0 comments on commit ba2b7e8

Please sign in to comment.