diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:11:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:11:27 +0000 |
commit | f3bcaf9f88aad2c423ebcd61121562f9834187d4 (patch) | |
tree | f22238c29b57707b645a350940e3e9bdf3ce1f5d /testing/marionette/harness/marionette_harness/marionette_test | |
parent | Adding debian version 115.7.0esr-1~deb12u1. (diff) | |
download | firefox-esr-f3bcaf9f88aad2c423ebcd61121562f9834187d4.tar.xz firefox-esr-f3bcaf9f88aad2c423ebcd61121562f9834187d4.zip |
Merging upstream version 115.8.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/marionette/harness/marionette_harness/marionette_test')
-rw-r--r-- | testing/marionette/harness/marionette_harness/marionette_test/testcases.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/testing/marionette/harness/marionette_harness/marionette_test/testcases.py b/testing/marionette/harness/marionette_harness/marionette_test/testcases.py index 32c36967bb..84a6e09665 100644 --- a/testing/marionette/harness/marionette_harness/marionette_test/testcases.py +++ b/testing/marionette/harness/marionette_harness/marionette_test/testcases.py @@ -2,7 +2,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -import imp + import os import re import sys @@ -14,6 +14,7 @@ from unittest.case import SkipTest import six from marionette_driver.errors import TimeoutException, UnresponsiveInstanceException +from mozfile import load_source from mozlog import get_default_logger @@ -365,21 +366,20 @@ class MarionetteTestCase(CommonTestCase): testvars, **kwargs ): - # since we use imp.load_source to load test modules, if a module - # is loaded with the same name as another one the module would just be - # reloaded. + # since load_source caches modules, if a module is loaded with the same + # name as another one the module would just be reloaded. # - # We may end up by finding too many test in a module then since - # reload() only update the module dict (so old keys are still there!) - # see https://docs.python.org/2/library/functions.html#reload + # We may end up by finding too many test in a module then since reload() + # only update the module dict (so old keys are still there!) see + # https://docs.python.org/2/library/functions.html#reload # - # we get rid of that by removing the module from sys.modules, - # so we ensure that it will be fully loaded by the - # imp.load_source call. + # we get rid of that by removing the module from sys.modules, so we + # ensure that it will be fully loaded by the imp.load_source call. + if mod_name in sys.modules: del sys.modules[mod_name] - test_mod = imp.load_source(mod_name, filepath) + test_mod = load_source(mod_name, filepath) for name in dir(test_mod): obj = getattr(test_mod, name) |