From d9eea2da2554d33efd5693b2aa0fe81bd3b4168b Mon Sep 17 00:00:00 2001 From: Crivella Date: Sun, 20 Sep 2020 01:23:12 +0200 Subject: [PATCH] Fixed pre-commit --- tests/calculations/test_pw2gw.py | 45 ++++++++++++++------------------ 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/tests/calculations/test_pw2gw.py b/tests/calculations/test_pw2gw.py index 26675f781..2ed79d491 100644 --- a/tests/calculations/test_pw2gw.py +++ b/tests/calculations/test_pw2gw.py @@ -6,6 +6,7 @@ from aiida import orm from aiida.common import datastructures + @pytest.fixture() def parameters(): """Fixture: parameters for pw calculation.""" @@ -22,7 +23,12 @@ def parameters(): return parameters -@pytest.fixture(params=[False,], ids=['base', ]) + +@pytest.fixture(params=[ + False, +], ids=[ + 'base', +]) def settings(request): """Fixture: parameters for z2pack calculation.""" settings = {} @@ -32,15 +38,19 @@ def settings(request): return settings + @pytest.fixture def remote(fixture_localhost, tmpdir, generate_remote_data): """Fixture: Remote folder created by a CalcJob with inputs.""" remote = generate_remote_data( - fixture_localhost, str(tmpdir), 'quantumespresso.pw', - ) + fixture_localhost, + str(tmpdir), + 'quantumespresso.pw', + ) return remote + @pytest.fixture() def inputs(fixture_code, remote, parameters, settings): """Fixture: inputs for Z2packBaseWorkChain.""" @@ -57,17 +67,12 @@ def inputs(fixture_code, remote, parameters, settings): } return inputs + @pytest.mark.parametrize( - 'settings,with_symlink', - [ - (False, False), - (True, True)], ids=['base', 'with_symlink' - ], - indirect=['settings'] - ) + 'settings,with_symlink', [(False, False), (True, True)], ids=['base', 'with_symlink'], indirect=['settings'] +) def test_pw2gw_default( - aiida_profile, fixture_sandbox, generate_calc_job, tmpdir, - file_regression, remote, inputs, with_symlink + aiida_profile, fixture_sandbox, generate_calc_job, tmpdir, file_regression, remote, inputs, with_symlink ): """Test a default `Pw2gwCalculation`.""" entry_point_name = 'quantumespresso.pw2gw' @@ -77,22 +82,12 @@ def test_pw2gw_default( retrieve_list = ['aiida.out', 'epsX.dat', 'epsY.dat', 'epsZ.dat', 'epsTOT.dat'] remote_copy_list = [ - ( - remote.computer.uuid, - os.path.join(remote.get_remote_path(), path), - path - ) for path in ['./pseudo/'] - ] + (remote.computer.uuid, os.path.join(remote.get_remote_path(), path), path) for path in ['./pseudo/'] + ] remote_symlink_list = [] ptr = remote_copy_list if not with_symlink else remote_symlink_list - ptr.extend([ - ( - remote.computer.uuid, - os.path.join(remote.get_remote_path(), path), - path - ) for path in ['./out/'] - ]) + ptr.extend([(remote.computer.uuid, os.path.join(remote.get_remote_path(), path), path) for path in ['./out/']]) assert isinstance(calc_info, datastructures.CalcInfo) assert sorted(calc_info.retrieve_list) == sorted(retrieve_list)