From ec1453728770dc8b8877f7aef888c7ccca5a3d05 Mon Sep 17 00:00:00 2001 From: Joris Roovers Date: Sat, 31 Oct 2020 12:04:37 +0100 Subject: Replace format() with f-strings Replaces most occurences for format() with f-strings (supported since Python 3.6) - this makes for more readable code in most cases. Relates to #151 --- qa/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qa/base.py') diff --git a/qa/base.py b/qa/base.py index 02118d7..2dd2715 100644 --- a/qa/base.py +++ b/qa/base.py @@ -57,7 +57,8 @@ class BaseTestCase(TestCase): @classmethod def generate_temp_path(cls): - return os.path.realpath("/tmp/gitlint-test-{0}".format(datetime.now().strftime("%Y%m%d-%H%M%S-%f"))) + timestamp = datetime.now().strftime("%Y%m%d-%H%M%S-%f") + return os.path.realpath(f"/tmp/gitlint-test-{timestamp}") @classmethod def create_tmp_git_repo(cls): -- cgit v1.2.3