diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-05-09 11:24:23 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-05-09 11:24:25 +0200 |
commit | 155a355e01d63669912ad0cfe2a1969b486373fb (patch) | |
tree | 37f64ba24801d6a533d474c86797714ee811242f /suites/dyn_ts_osmo/mo_mt_call_dyn_osmo.py | |
parent | 415f34d3e9916a9af0ef6a69186ef7cce980c32c (diff) |
Unload suite local modules after suite exit to avoid collisions
Since sys.path is modified idynamically to load modules from "lib" subdir of each suite, from python env point of view all those modules share a namespace. As a result, there can be name collisions.
If a name collision appears (eg test1 loads "testlib.py" and test2
afterwards also loads its own "testlib.py"), then python interpreter
thinks the testlib.py module is already loaded, so test2 ends up using
"testlib.py" from test1.
The way to solve this is to make suite local
modules to live only through the scope of the suite, and unload the
modules once the suite is finished.
Change-Id: I4efe815f85bc4ec2ca91aa9c2d3a369048f21571
Diffstat (limited to 'suites/dyn_ts_osmo/mo_mt_call_dyn_osmo.py')
-rwxr-xr-x | suites/dyn_ts_osmo/mo_mt_call_dyn_osmo.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/suites/dyn_ts_osmo/mo_mt_call_dyn_osmo.py b/suites/dyn_ts_osmo/mo_mt_call_dyn_osmo.py index c7fe0c3..1424da8 100755 --- a/suites/dyn_ts_osmo/mo_mt_call_dyn_osmo.py +++ b/suites/dyn_ts_osmo/mo_mt_call_dyn_osmo.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 from osmo_gsm_tester.testenv import * +import testlib +suite.test_import_modules_register_for_cleanup(testlib) from testlib import call_test_setup_run def my_bts_setup(bts): |