Skip to content

Commit c071259

Browse files
Styling.
1 parent 34039ae commit c071259

14 files changed

Lines changed: 41 additions & 45 deletions

source/fab/steps/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Predefined build steps with sensible defaults.
88
"""
99
import multiprocessing
10-
from typing import Any, Iterable, Optional, Union
10+
from typing import Iterable, Optional, Union
1111

1212
from fab.metrics import send_metric
1313
from fab.util import by_type, TimerLogger

tests/system_tests/zero_config/test_zero_config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
from pathlib import Path
22
from shutil import copytree
3-
from subprocess import run
43

54
from pytest import warns
65

76
from fab.cli import cli_fab
8-
from fab.tools import ToolRepository
97

108

119
class TestZeroConfig:

tests/unit_tests/steps/test_analyse.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
from fab.build_config import BuildConfig
88
from fab.dep_tree import AnalysedDependent
9-
from fab.parse.fortran import (AnalysedFortran, FortranParserWorkaround,
10-
file_checksum)
9+
from fab.parse.fortran import AnalysedFortran, FortranParserWorkaround
1110
from fab.steps.analyse import (_add_manual_results, _add_unreferenced_deps,
1211
_gen_file_deps, _gen_symbol_table, _parse_files)
1312
from fab.tools import ToolBox

tests/unit_tests/steps/test_archive_objects.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
Test for the archive step.
88
"""
99
from pathlib import Path
10-
from unittest import mock
11-
from unittest.mock import call
1210

1311
from pytest import raises, warns
1412
from pytest_subprocess.fake_process import FakeProcess

tests/unit_tests/steps/test_compile_c.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"""
77
Exercises the compiler step.
88
"""
9-
import os
109
from pathlib import Path
1110
from unittest.mock import Mock
1211

@@ -79,14 +78,13 @@ def test_vanilla(self, content,
7978
config, _ = content
8079

8180
monkeypatch.setenv('CFLAGS', '-Denv_flag')
82-
81+
8382
fake_process.register(['scc', '--version'], stdout='1.2.3')
8483
fake_process.register([
8584
'scc', '-c', '-Denv_flag', '-I', 'foo/include',
8685
'-Dhello', 'foo.c',
8786
'-o', str(config.prebuild_folder / 'foo.12df783ad.o')
8887
])
89-
compiler = config.tool_box[Category.C_COMPILER]
9088
with warns(UserWarning, match="_metric_send_conn not set, "
9189
"cannot send metrics"):
9290
compile_c(config=config,
@@ -110,7 +108,6 @@ def test_exception_handling(self, content,
110108
'scc', '-c', 'foo.c',
111109
'-o', str(config.build_output / '_prebuild/foo.f4399d2d.o')
112110
], returncode=1)
113-
compiler = config.tool_box[Category.C_COMPILER]
114111
with raises(RuntimeError):
115112
compile_c(config=config)
116113

tests/unit_tests/steps/test_compile_fortran.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from pytest import fixture, mark, raises, warns
66
from pytest_subprocess.fake_process import FakeProcess
7-
from pyfakefs.fake_filesystem_unittest import Patcher
87

98
from fab.artefacts import ArtefactSet, ArtefactStore
109
from fab.build_config import BuildConfig, FlagsConfig
@@ -66,8 +65,8 @@ def test_compile_cc_wrong_compiler(stub_tool_box,
6665
with raises(RuntimeError) as err:
6766
handle_compiler_args(config)
6867
assert str(err.value) \
69-
== "Unexpected tool 'some Fortran compiler' of category " \
70-
+ "'C_COMPILER' instead of FortranCompiler"
68+
== "Unexpected tool 'some Fortran compiler' of category " \
69+
+ "'C_COMPILER' instead of FortranCompiler"
7170

7271

7372
class TestCompilePass:
@@ -82,7 +81,7 @@ def test_vanilla(self, analysed_files, stub_tool_box: ToolBox,
8281
"""
8382
a, b, c = analysed_files
8483

85-
fake_process.register(['sfc', '--version'], stdout = '1.2.3')
84+
fake_process.register(['sfc', '--version'], stdout='1.2.3')
8685
fake_process.register(['sfc', fake_process.any()])
8786

8887
uncompiled = {a, b}
@@ -91,13 +90,6 @@ def test_vanilla(self, analysed_files, stub_tool_box: ToolBox,
9190
tmp_path / 'proj/build_output/_prebuild/' / c.fpath.name)
9291
}
9392

94-
run_mp_results = [
95-
(
96-
CompiledFile(tmp_path / 'proj/build_output/b.f90',
97-
output_fpath=tmp_path / 'proj/build_output/_prebuild/b.123.o')
98-
)
99-
]
100-
10193
# this gets filled in
10294
mod_hashes: Dict[str, int] = {}
10395

tests/unit_tests/steps/test_link.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from tests.conftest import call_list
1515

16-
from fab.artefacts import ArtefactSet, ArtefactStore
16+
from fab.artefacts import ArtefactSet
1717
from fab.build_config import BuildConfig
1818
from fab.steps.link import link_exe
1919
from fab.tools.compiler import FortranCompiler

tests/unit_tests/steps/test_link_shared_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_run(fake_process: FakeProcess, monkeypatch) -> None:
5252
{None: {'foo.o', 'bar.o'}}
5353

5454
with warns(UserWarning, match="_metric_send_conn not set, "
55-
"cannot send metrics"):
55+
"cannot send metrics"):
5656
link_shared_object(config, "/tmp/lib_my.so",
5757
flags=['-fooflag', '-barflag'])
5858
assert call_list(fake_process) == [

tests/unit_tests/steps/test_preprocess.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from pytest import raises, warns
99
from pytest_subprocess.fake_process import FakeProcess
1010

11-
from fab.artefacts import ArtefactSet, ArtefactStore, ArtefactsGetter
1211
from fab.build_config import BuildConfig
1312
from fab.steps.preprocess import preprocess_fortran
1413
from fab.tools.category import Category

tests/unit_tests/steps/test_psyclone_unit_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from fab.parse.x90 import AnalysedX90
1414
from fab.steps.psyclone import _check_override, _gen_prebuild_hash, MpCommonArgs
15-
from fab.util import file_checksum, string_checksum
15+
from fab.util import string_checksum
1616

1717

1818
class TestGenPrebuildHash:

0 commit comments

Comments
 (0)