summaryrefslogtreecommitdiffhomepage
path: root/test/test_python_environment.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-02-21 17:21:29 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2023-02-21 17:21:29 +0000
commit7934dcabbc3c2b585e8d3f8fcee7020ba26f1687 (patch)
treebd0861e7832c14d92dd0ed9753932e58a2daf818 /test/test_python_environment.py
parentfcabbf09d85397e244f6486d6eca25e2366b61cd (diff)
downloadunit-7934dcabbc3c2b585e8d3f8fcee7020ba26f1687.tar.gz
unit-7934dcabbc3c2b585e8d3f8fcee7020ba26f1687.tar.bz2
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.
Diffstat (limited to 'test/test_python_environment.py')
-rw-r--r--test/test_python_environment.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test_python_environment.py b/test/test_python_environment.py
index 2d7d1595..bce72c4d 100644
--- a/test/test_python_environment.py
+++ b/test/test_python_environment.py
@@ -38,7 +38,7 @@ class TestPythonEnvironment(TestApplicationPython):
'Connection': 'close',
}
)['body']
- == 'val1,'
+ == 'val1'
), 'set'
self.conf({"var": "val2"}, 'applications/environment/environment')
@@ -51,7 +51,7 @@ class TestPythonEnvironment(TestApplicationPython):
'Connection': 'close',
}
)['body']
- == 'val2,'
+ == 'val2'
), 'update'
def test_python_environment_replace(self):
@@ -67,7 +67,7 @@ class TestPythonEnvironment(TestApplicationPython):
'Connection': 'close',
}
)['body']
- == 'val1,'
+ == 'val1'
), 'set'
self.conf({"var2": "val2"}, 'applications/environment/environment')
@@ -80,7 +80,7 @@ class TestPythonEnvironment(TestApplicationPython):
'Connection': 'close',
}
)['body']
- == 'val2,'
+ == 'val2'
), 'replace'
def test_python_environment_clear(self):
@@ -99,7 +99,7 @@ class TestPythonEnvironment(TestApplicationPython):
'Connection': 'close',
}
)['body']
- == 'val1,val2,'
+ == 'val1,val2'
), 'set'
self.conf({}, 'applications/environment/environment')
@@ -138,7 +138,7 @@ class TestPythonEnvironment(TestApplicationPython):
'Connection': 'close',
}
)['body']
- == '/,'
+ == '/'
), 'replace default'
self.conf({}, 'applications/environment/environment')