-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add try-import for mmdet * revise import logic * add unit test for try_import Co-authored-by: Yanhong Zeng <zengyh1900@gmail.com> Co-authored-by: Yifei Yang <2744335995@qq.com>
- Loading branch information
1 parent
3a18501
commit b70695d
Showing
4 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
from mmedit.utils import register_all_modules | ||
from mmedit.utils import register_all_modules, try_import | ||
|
||
|
||
def test_register_all_modules(): | ||
register_all_modules() | ||
|
||
|
||
def test_try_import(): | ||
import numpy as np | ||
assert try_import('numpy') is np | ||
assert try_import('numpy111') is None |