Skip to content

Commit

Permalink
Fix ruff UP031 error on qgis_testrunner.py
Browse files Browse the repository at this point in the history
This crashed the pre-commit update job.
  • Loading branch information
visr committed Jul 4, 2024
1 parent 1903193 commit c3eba84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit_auto_update.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pre-commit
name: Pre-commit auto update

on:
schedule:
Expand Down
8 changes: 4 additions & 4 deletions ribasim_qgis/scripts/qgis_testrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

def __get_test_function(test_module_name):
"""Load the test module and return the test function"""
print("QGIS Test Runner - Trying to import %s" % test_module_name)
print(f"QGIS Test Runner - Trying to import {test_module_name}")
try:
test_module = importlib.import_module(test_module_name)
function_name = "run_all"
Expand All @@ -72,7 +72,7 @@ def __get_test_function(test_module_name):
test_module_name[:pos],
test_module_name[pos + 1 :],
)
print("QGIS Test Runner - Trying to import %s" % test_module_name)
print(f"QGIS Test Runner - Trying to import {test_module_name}")
sys.stdout.flush()
try:
test_module = importlib.import_module(test_module_name)
Expand Down Expand Up @@ -119,11 +119,11 @@ def __run_test():
try:
test_module_name = QgsApplication.instance().arguments()[-1]
function_name = __get_test_function(test_module_name)
print("QGIS Test Runner Inside - executing function %s" % function_name)
print(f"QGIS Test Runner Inside - executing function {function_name}")
function_name()
__exit_qgis(signal.SIG_DFL)
except Exception as e:
logging.error("QGIS Test Runner Inside - [FAILED] Exception: %s" % e)
logging.error(f"QGIS Test Runner Inside - [FAILED] Exception: {e}")
# Print tb
traceback.print_exc(file=sys.stderr)
__exit_qgis(signal.SIGTERM)
Expand Down

0 comments on commit c3eba84

Please sign in to comment.