From 7934dcabbc3c2b585e8d3f8fcee7020ba26f1687 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Tue, 21 Feb 2023 17:21:29 +0000 Subject: Tests: switched to using f-strings. Previously, it was necessary to support older versions of Python for compatibility. F-strings were released in Python 3.6. Python 3.5 was marked as unsupported by the end of 2020, so now it's possible to start using f-strings safely for better readability and performance. --- test/test_status.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/test_status.py') diff --git a/test/test_status.py b/test/test_status.py index 6c733474..d0901f42 100644 --- a/test/test_status.py +++ b/test/test_status.py @@ -18,11 +18,12 @@ class TestStatus(TestApplicationPython): } def app_default(self, name="empty", module="wsgi"): + name_dir = f'{option.test_dir}/python/{name}' return { "type": self.get_application_type(), "processes": {"spare": 0}, - "path": option.test_dir + "/python/" + name, - "working_directory": option.test_dir + "/python/" + name, + "path": name_dir, + "working_directory": name_dir, "module": module, } @@ -141,7 +142,7 @@ Connection: close assert apps == expert.sort() def check_application(name, running, starting, idle, active): - Status.get('/applications/' + name) == { + Status.get(f'/applications/{name}') == { 'processes': { 'running': running, 'starting': starting, -- cgit