summaryrefslogtreecommitdiff
path: root/tests/testutil.py
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-09-26 13:00:56 +0200
committerMichał Górny <mgorny@gentoo.org>2022-09-26 13:03:05 +0200
commite907b0f04354873316311072da572943abb6281a (patch)
tree1f8129299e812a3aa2fe5e1e9a9c823ce58772c7 /tests/testutil.py
parent572da07948b921feb35af5b098f50af7d8dea99a (diff)
downloadgemato-e907b0f04354873316311072da572943abb6281a.tar.gz
Modernize via pyupgrade
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'tests/testutil.py')
-rw-r--r--tests/testutil.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/testutil.py b/tests/testutil.py
index bde84f7..2becb23 100644
--- a/tests/testutil.py
+++ b/tests/testutil.py
@@ -1,6 +1,5 @@
# gemato: Test utility functions
-# vim:fileencoding=utf-8
-# (c) 2017-2020 Michał Górny
+# (c) 2017-2022 Michał Górny
# Licensed under the terms of 2-clause BSD license
import errno
@@ -49,17 +48,17 @@ class TempDirTestCase(LoggingTestCase):
FILES = {}
def setUp(self):
- super(TempDirTestCase, self).setUp()
+ super().setUp()
self.dir = tempfile.mkdtemp()
for k in self.DIRS:
os.mkdir(os.path.join(self.dir, k))
for k, v in self.FILES.items():
- with io.open(os.path.join(self.dir, k), 'w', encoding='utf8') as f:
+ with open(os.path.join(self.dir, k), 'w', encoding='utf8') as f:
f.write(v)
def tearDown(self):
shutil.rmtree(self.dir)
- super(TempDirTestCase, self).tearDown()
+ super().tearDown()
class HKPServerRequestHandler(BaseHTTPRequestHandler):