Skip to content

Commit

Permalink
tests/storage_reflink: fix pylint complaints
Browse files Browse the repository at this point in the history
line-too-long, super-with-arguments, subprocess-run-check
  • Loading branch information
rustybird committed Feb 2, 2022
1 parent 1cc8497 commit dc4f563
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions qubes/tests/storage_reflink.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
class TestApp(qubes.Qubes):
''' A Mock App object '''
def __init__(self, *args, **kwargs): # pylint: disable=unused-argument
super(TestApp, self).__init__('/tmp/qubes-test.xml', load=False,
offline_mode=True, **kwargs)
super().__init__('/tmp/qubes-test.xml', load=False,
offline_mode=True, **kwargs)
self.load_initial_values()


Expand Down Expand Up @@ -113,7 +113,7 @@ def tearDown(self) -> None:
del self.pool
self.app.close()
del self.app
super(TC_10_ReflinkPool, self).tearDown()
super().tearDown()

def test_012_import_data_empty(self):
config = {
Expand All @@ -129,7 +129,8 @@ def test_012_import_data_empty(self):
volume_exported = self.loop.run_until_complete(volume.export())
with open(volume_exported, 'w') as volume_file:
volume_file.write('test data')
import_path = self.loop.run_until_complete(volume.import_data(volume.size))
import_path = self.loop.run_until_complete(
volume.import_data(volume.size))
self.assertNotEqual(volume.path, import_path)
with open(import_path, 'w+'):
pass
Expand Down Expand Up @@ -207,7 +208,8 @@ def reflink_update_loopdev_sizes(img):
cmd('sudo', '-E', 'env', *env, sys.executable, '-c', code)

def cmd(*argv):
p = subprocess.run(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.run(
argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False)
if p.returncode != 0:
raise Exception(str(p)) # this will show stdout and stderr
return p.stdout

0 comments on commit dc4f563

Please sign in to comment.