Skip to content

Commit

Permalink
fix: class in __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ming5024 committed Jul 25, 2023
1 parent 588ac01 commit 4353c3b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions testbase/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ def _load(self, testname):
try:
module = __import__(modulename) # __import__得到的是最外层模块的object
except Exception as ex: # pylint: disable=broad-except
if i == len(parts) and hasattr(module, parts[-1]): # 类写在__init__.py的场景下module需返回文件夹
i -= 1
break

Check warning on line 148 in testbase/loader.py

View check run for this annotation

Codecov / codecov/patch

testbase/loader.py#L147-L148

Added lines #L147 - L148 were not covered by tests
self._module_errs[modulename] = traceback.format_exc()
return
else:
Expand Down

0 comments on commit 4353c3b

Please sign in to comment.