diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 25059107..06133d0b 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -12,6 +12,7 @@ **Fixed** - fix: incorrect summary success when testcase failed +- fix: reload to refresh previously loaded debugtalk module ## 3.0.10 (2020-06-07) diff --git a/httprunner/loader.py b/httprunner/loader.py index 4982eb92..9592e5bf 100644 --- a/httprunner/loader.py +++ b/httprunner/loader.py @@ -371,6 +371,8 @@ def load_debugtalk_functions() -> Dict[Text, Callable]: """ # load debugtalk.py module imported_module = importlib.import_module("debugtalk") + # reload to refresh previously loaded module + imported_module = importlib.reload(imported_module) return load_module_functions(imported_module) diff --git a/tests/compat_test.py b/tests/compat_test.py index 5e80e6d6..49e78500 100644 --- a/tests/compat_test.py +++ b/tests/compat_test.py @@ -1,11 +1,14 @@ import os import unittest -from httprunner import compat, exceptions +from httprunner import compat, exceptions, loader from httprunner.compat import convert_variables class TestCompat(unittest.TestCase): + def setUp(self): + loader.project_meta = None + def test_convert_variables(self): raw_variables = [{"var1": 1}, {"var2": "val2"}] self.assertEqual(