diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-10-27 20:27:57 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-27 20:27:57 +0200 |
commit | e1c1f04368fda9eccbc2ea113054e1034453a728 (patch) | |
tree | a14d4706085c22f7840448b2674ba58b37cac824 /tests | |
parent | 2d69c2f2cd43fea3e4d153b3853a2eacf8aeac67 (diff) | |
download | gemato-e1c1f04368fda9eccbc2ea113054e1034453a728.tar.gz |
test_verify: Use io.open() instead of open()
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_verify.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_verify.py b/tests/test_verify.py index a9e7a5e..7217ccb 100644 --- a/tests/test_verify.py +++ b/tests/test_verify.py @@ -3,6 +3,7 @@ # (c) 2017 Michał Górny # Licensed under the terms of 2-clause BSD license +import io import os import os.path import socket @@ -533,7 +534,7 @@ class SymbolicLinkVerificationTest(NonEmptyFileVerificationTest): self.dir = tempfile.mkdtemp() self.real_path = os.path.join(self.dir, 'real') self.path = os.path.join(self.dir, 'symlink') - with open(self.real_path, 'wb') as f: + with io.open(self.real_path, 'wb') as f: f.write(TEST_STRING) os.symlink('real', self.path) @@ -581,7 +582,7 @@ class ProcFileVerificationTest(unittest.TestCase): def setUp(self): self.path = '/proc/version' try: - with open(self.path, 'rb') as f: + with io.open(self.path, 'rb') as f: data = f.read() st = os.fstat(f.fileno()) except: @@ -705,7 +706,7 @@ class UnreadableFileVerificationTest(unittest.TestCase): def setUp(self): self.dir = tempfile.mkdtemp() self.path = os.path.join(self.dir, 'test') - with open(self.path, 'w'): + with io.open(self.path, 'w'): pass os.chmod(self.path, 0) |