fix #1217: reload debugtalk.py if loaded

This commit is contained in:
debugtalk
2022-04-30 14:57:08 +08:00
parent 81cca335d8
commit 6af68be8be
2 changed files with 10 additions and 1 deletions
+4
View File
@@ -1,5 +1,9 @@
# Release History # Release History
## 2.5.9 (2022-04-30)
- fix #1217: reload debugtalk.py if loaded
## 2.5.8 (2022-03-23) ## 2.5.8 (2022-03-23)
- change: replace events reporter from sentry to Google Analytics - change: replace events reporter from sentry to Google Analytics
+6 -1
View File
@@ -1,5 +1,6 @@
import importlib import importlib
import os import os
import sys
from httprunner import exceptions, logger, utils from httprunner import exceptions, logger, utils
from httprunner.loader.check import JsonSchemaChecker from httprunner.loader.check import JsonSchemaChecker
@@ -26,7 +27,11 @@ def load_debugtalk_functions():
""" """
# load debugtalk.py module # load debugtalk.py module
imported_module = importlib.import_module("debugtalk") if sys.modules.get('debugtalk'):
imported_module = importlib.reload(sys.modules['debugtalk'])
else:
imported_module = importlib.import_module("debugtalk")
return load_module_functions(imported_module) return load_module_functions(imported_module)