[V1] framework/tester:optimize handing of import error
Checks
Context |
Check |
Description |
ci/Intel-dts-format-test |
success
|
Testing OK
|
ci/Intel-dts-pylama-test |
success
|
Testing OK
|
ci/Intel-dts-suite-test |
success
|
Testing OK
|
Commit Message
the scapy import module failed, it may not be ImportError.
except to import class failed, the module may also fail to import.
if the from module name does not exist, it's will report ModuleNotFoundError.
so add ModuleNotFoundError error in judgement.
Signed-off-by: Zhimin Huang <zhiminx.huang@intel.com>
---
framework/tester.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sat, 17 Sep 2022 21:04:18 +0800, Zhimin Huang <zhiminx.huang@intel.com> wrote:
> the scapy import module failed, it may not be ImportError.
> except to import class failed, the module may also fail to import.
> if the from module name does not exist, it's will report ModuleNotFoundError.
> so add ModuleNotFoundError error in judgement.
>
> Signed-off-by: Zhimin Huang <zhiminx.huang@intel.com>
Applied, thanks
@@ -87,7 +87,7 @@ class Tester(Crb):
# import scapy moudle to scapy APP
out = session.session.send_expect(get_scapy_module_impcmd(), ">>> ")
- if "ImportError" in out:
+ if "ImportError" in out or "ModuleNotFoundError" in out:
session.logger.warning(f"entering import error: {out}")
return session