Skip to content

Commit 710cdd7

Browse files
test_geophires_examples formatting tweak to make temporary local override of example list more convenient and address outer scope name shadowing PyCharm linter complaint
1 parent 4484071 commit 710cdd7

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tests/test_geophires_x.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,29 @@ def test_geophires_examples(self):
160160
def get_output_file_for_example(example_file: str):
161161
return self._get_test_file_path(Path('examples', f'{example_file.split(".txt")[0]}.out'))
162162

163+
# fmt:off
163164
# @formatter:off
164165
example_files = list(
165166
filter(
166-
lambda example_file_path: example_file_path.startswith(
167-
('example', 'Beckers_et_al', 'SUTRA', 'Wanju', 'Fervo', 'S-DAC-GT')
167+
lambda example_file_path_: example_file_path_.startswith(
168+
(
169+
'example',
170+
'Beckers_et_al',
171+
'SUTRA',
172+
'Wanju',
173+
'Fervo',
174+
'S-DAC-GT'
175+
)
168176
)
169177
# TOUGH not enabled for testing - see https://github.com/NREL/GEOPHIRES-X/issues/318
170-
and not example_file_path.startswith(('example6.txt', 'example7.txt'))
171-
and '.out' not in example_file_path,
178+
and not example_file_path_.startswith(('example6.txt', 'example7.txt'))
179+
and '.out' not in example_file_path_,
172180
self._list_test_files_dir(test_files_dir='examples'),
173181
)
174182
)
175183
# @formatter:on
184+
# fmt:on
185+
# (2 types of formatting control markers above to prevent both ruff/black and PyCharm from applying formatting)
176186

177187
# Run SBT examples last because they take an inordinately long time (tens of seconds even on a fast machine).
178188
# This reduces time spent waiting for tests to run if you are iterating on changes that affect non-SBT examples.

0 commit comments

Comments
 (0)