Skip to content

Commit 4a7bac6

Browse files
committed
Fix indent
1 parent 1a426f4 commit 4a7bac6

16 files changed

+111
-109
lines changed

test/framework/build_log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def test_easybuildlog(self):
151151
self.assertRaisesRegex(EasyBuildError, r"DEPRECATED \(since .*: kaput", log.deprecated, "kaput", older_ver)
152152
self.assertRaisesRegex(EasyBuildError, r"DEPRECATED \(since .*: 2>1", log.deprecated, "2>1", '2.0', '1.0')
153153
self.assertRaisesRegex(EasyBuildError, r"DEPRECATED \(since .*: 2>1", log.deprecated, "2>1", '2.0',
154-
max_ver='1.0')
154+
max_ver='1.0')
155155

156156
# wipe log so we can reuse it
157157
write_file(tmplog, '')
@@ -435,7 +435,7 @@ def test_init_logging(self):
435435

436436
def test_raise_nosupport(self):
437437
self.assertRaisesRegex(EasyBuildError, 'NO LONGER SUPPORTED since v42: foobar;',
438-
raise_nosupport, 'foobar', 42)
438+
raise_nosupport, 'foobar', 42)
439439

440440

441441
def suite(loader=None):

test/framework/containers.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,10 @@ def test_end2end_dockerfile(self):
381381

382382
error_pattern = "Unsupported container config 'not-supported'"
383383
self.assertRaisesRegex(EasyBuildError,
384-
error_pattern,
385-
self.run_main,
386-
base_args + ['--container-config=not-supported'],
387-
raise_error=True)
384+
error_pattern,
385+
self.run_main,
386+
base_args + ['--container-config=not-supported'],
387+
raise_error=True)
388388

389389
for cont_base in ['ubuntu:20.04', 'centos:7']:
390390
stdout, stderr = self.run_main(base_args + ['--container-config=%s' % cont_base])
@@ -398,10 +398,10 @@ def test_end2end_dockerfile(self):
398398
error_pattern = "Container recipe at %s/containers/Dockerfile.toy-0.0 already exists, " \
399399
"not overwriting it without --force" % self.test_prefix
400400
self.assertRaisesRegex(EasyBuildError,
401-
error_pattern,
402-
self.run_main,
403-
base_args + ['--container-config=centos:7'],
404-
raise_error=True)
401+
error_pattern,
402+
self.run_main,
403+
base_args + ['--container-config=centos:7'],
404+
raise_error=True)
405405

406406
remove_file(os.path.join(self.test_prefix, 'containers', 'Dockerfile.toy-0.0'))
407407

test/framework/easyblock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,7 +1972,7 @@ def test_fetch_sources(self):
19721972
eb.src = []
19731973
error_msg = r"DEPRECATED \(since v4.0\).*Using a 2-element list/tuple.*"
19741974
self.assertRaisesRegex(EasyBuildError, error_msg, eb.fetch_sources,
1975-
[('toy-0.0_gzip.patch.gz', "gunzip %s")], checksums=[])
1975+
[('toy-0.0_gzip.patch.gz', "gunzip %s")], checksums=[])
19761976

19771977
# unknown dict keys in sources are reported
19781978
sources[0]['nosuchkey'] = 'foobar'
@@ -2212,7 +2212,7 @@ def test_obtain_file(self):
22122212
error_pattern = "Couldn't find file 'toy-0.0.tar.gz' anywhere, and downloading it is disabled"
22132213
with self.mocked_stdout_stderr():
22142214
self.assertRaisesRegex(EasyBuildError, error_pattern, eb.obtain_file,
2215-
toy_tarball, urls=urls, alt_location='alt_toy', no_download=True)
2215+
toy_tarball, urls=urls, alt_location='alt_toy', no_download=True)
22162216

22172217
# 'downloading' a file to (first) alternative sourcepath works
22182218
with self.mocked_stdout_stderr():

test/framework/easyconfig.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def test_extra_options(self):
444444
# test extra mandatory parameters
445445
extra_vars.update({'mandatory_key': ['default', 'another mandatory key', easyconfig.MANDATORY]})
446446
self.assertRaisesRegex(EasyBuildError, r"mandatory parameters not provided",
447-
EasyConfig, self.eb_file, extra_options=extra_vars)
447+
EasyConfig, self.eb_file, extra_options=extra_vars)
448448

449449
self.contents += '\nmandatory_key = "value"'
450450
self.prep()
@@ -1719,7 +1719,7 @@ def test_build_options(self):
17191719
self.prep()
17201720
eb = EasyConfig(self.eb_file, validate=False)
17211721
self.assertRaisesRegex(EasyBuildError, "Build option lists for iterated build should have same length",
1722-
eb.validate)
1722+
eb.validate)
17231723

17241724
# list with a single element is OK, is treated as a string
17251725
installopts = ['FOO=foo']
@@ -1930,7 +1930,7 @@ def test_filter_deps(self):
19301930
write_file(ec_file, ec_txt)
19311931

19321932
self.assertRaisesRegex(EasyBuildError, "Failed to determine minimal toolchain for dep .*",
1933-
EasyConfig, ec_file, validate=False)
1933+
EasyConfig, ec_file, validate=False)
19341934

19351935
build_options.update({'filter_deps': ['deptobefiltered']})
19361936
init_config(build_options=build_options)
@@ -3863,18 +3863,18 @@ def test_categorize_files_by_type(self):
38633863
tmpdir = tempfile.mkdtemp()
38643864
non_existing = os.path.join(tmpdir, 'does_not_exist.patch')
38653865
self.assertRaisesRegex(EasyBuildError,
3866-
"File %s does not exist" % non_existing,
3867-
categorize_files_by_type, [non_existing])
3866+
"File %s does not exist" % non_existing,
3867+
categorize_files_by_type, [non_existing])
38683868
patch_dir = os.path.join(tmpdir, 'folder.patch')
38693869
os.mkdir(patch_dir)
38703870
self.assertRaisesRegex(EasyBuildError,
3871-
"File %s is expected to be a regular file" % patch_dir,
3872-
categorize_files_by_type, [patch_dir])
3871+
"File %s is expected to be a regular file" % patch_dir,
3872+
categorize_files_by_type, [patch_dir])
38733873
invalid_patch = os.path.join(tmpdir, 'invalid.patch')
38743874
copy_file(gzip_ec, invalid_patch)
38753875
self.assertRaisesRegex(EasyBuildError,
3876-
"%s is not detected as a valid patch file" % invalid_patch,
3877-
categorize_files_by_type, [invalid_patch])
3876+
"%s is not detected as a valid patch file" % invalid_patch,
3877+
categorize_files_by_type, [invalid_patch])
38783878

38793879
def test_resolve_template(self):
38803880
"""Test resolve_template function."""
@@ -3949,11 +3949,11 @@ def test_det_subtoolchain_version(self):
39493949
cands = [{'name': 'golfc', 'version': '2018a'},
39503950
{'name': 'golfc', 'version': '2018.01'}]
39513951
self.assertRaisesRegex(EasyBuildError,
3952-
"No version found for subtoolchain gompic in dependencies of fosscuda",
3953-
det_subtoolchain_version, current_tc, 'gompic', optional_toolchains, cands)
3952+
"No version found for subtoolchain gompic in dependencies of fosscuda",
3953+
det_subtoolchain_version, current_tc, 'gompic', optional_toolchains, cands)
39543954
self.assertRaisesRegex(EasyBuildError,
3955-
"Multiple versions of golfc found in dependencies of toolchain fosscuda: 2018.01, 2018a",
3956-
det_subtoolchain_version, current_tc, 'golfc', optional_toolchains, cands)
3955+
"Multiple versions of golfc found in dependencies of toolchain fosscuda: 2018.01, 2018a",
3956+
det_subtoolchain_version, current_tc, 'golfc', optional_toolchains, cands)
39573957

39583958
# missing candidate for golfc, ok for optional
39593959
cands = [{'name': 'gompic', 'version': '2018a'}]
@@ -4723,11 +4723,11 @@ def __init__(self, values):
47234723

47244724
error_msg = 'exts_filter should be a list or tuple'
47254725
self.assertRaisesRegex(EasyBuildError, error_msg, resolve_exts_filter_template,
4726-
'[ 1 == 1 ]', {})
4726+
'[ 1 == 1 ]', {})
47274727
self.assertRaisesRegex(EasyBuildError, error_msg, resolve_exts_filter_template,
4728-
['[ 1 == 1 ]'], {})
4728+
['[ 1 == 1 ]'], {})
47294729
self.assertRaisesRegex(EasyBuildError, error_msg, resolve_exts_filter_template,
4730-
['[ 1 == 1 ]', 'true', 'false'], {})
4730+
['[ 1 == 1 ]', 'true', 'false'], {})
47314731

47324732
test_cases = [
47334733
# Minimal case: just name

test/framework/ebconfigobj.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ def test_ebconfigobj_unusable_default(self):
8686
configobj_txt = ['[SUPPORTED]', val]
8787
co = ConfigObj(configobj_txt)
8888
self.assertRaisesRegex(EasyBuildError,
89-
r'First\s+(toolchain|version)\s.*?\scan\'t\s+be\s+used\s+as\s+default',
90-
EBConfigObj, co)
89+
r'First\s+(toolchain|version)\s.*?\scan\'t\s+be\s+used\s+as\s+default',
90+
EBConfigObj, co)
9191

9292
def test_squash_simple(self):
9393
"""Test toolchain filter"""
@@ -161,7 +161,7 @@ def test_squash_invalid(self):
161161
co = ConfigObj(txt)
162162
cov = EBConfigObj(co)
163163
self.assertRaisesRegex(EasyBuildError, r'conflict', cov.squash,
164-
default_version, tc_first['name'], tc_first['version'])
164+
default_version, tc_first['name'], tc_first['version'])
165165

166166
def test_toolchain_squash_nested(self):
167167
"""Test toolchain filter on nested sections"""

test/framework/filetools.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ def test_find_glob_pattern(self):
190190
os.path.join(tmpdir, 'python3.5m', 'include'))
191191
self.assertEqual(ft.find_glob_pattern(os.path.join(tmpdir, 'python3.6*'), False), None)
192192
self.assertRaisesRegex(EasyBuildError, "Was expecting exactly", ft.find_glob_pattern,
193-
os.path.join(tmpdir, 'python3.6*'))
193+
os.path.join(tmpdir, 'python3.6*'))
194194
self.assertRaisesRegex(EasyBuildError, "Was expecting exactly", ft.find_glob_pattern,
195-
os.path.join(tmpdir, 'python*'))
195+
os.path.join(tmpdir, 'python*'))
196196

197197
def test_encode_class_name(self):
198198
"""Test encoding of class names."""
@@ -360,8 +360,8 @@ def test_checksums(self):
360360
self.assertTrue(ft.verify_checksum(fp, {os.path.basename(fp): None}))
361361
faulty_dict = {'wrong-name': known_checksums['sha256']}
362362
self.assertRaisesRegex(EasyBuildError,
363-
"Missing checksum for " + os.path.basename(fp) + " in .*wrong-name.*",
364-
ft.verify_checksum, fp, faulty_dict)
363+
"Missing checksum for " + os.path.basename(fp) + " in .*wrong-name.*",
364+
ft.verify_checksum, fp, faulty_dict)
365365

366366
# check whether missing checksums are enforced
367367
build_options = {
@@ -374,7 +374,7 @@ def test_checksums(self):
374374

375375
# Test dictionary-type checksums
376376
self.assertRaisesRegex(EasyBuildError, "Missing checksum for", ft.verify_checksum,
377-
fp, {os.path.basename(fp): None})
377+
fp, {os.path.basename(fp): None})
378378
for checksum in [known_checksums[x] for x in ['sha256']]:
379379
dict_checksum = {os.path.basename(fp): checksum, 'foo': 'baa'}
380380
self.assertTrue(ft.verify_checksum(fp, dict_checksum))
@@ -881,9 +881,9 @@ def test_symlink_resolve_path(self):
881881
test_file2 = os.path.join(link_dir, 'test2.txt')
882882
ft.write_file(test_file, "test123")
883883
self.assertRaisesRegex(EasyBuildError,
884-
"Trying to symlink %s to %s, but the symlink already exists and points to %s." %
885-
(test_file2, link, test_file),
886-
ft.symlink, test_file2, link)
884+
"Trying to symlink %s to %s, but the symlink already exists and points to %s." %
885+
(test_file2, link, test_file),
886+
ft.symlink, test_file2, link)
887887

888888
# test resolve_path
889889
self.assertEqual(test_dir, ft.resolve_path(link_dir))
@@ -1436,7 +1436,8 @@ def test_adjust_permissions(self):
14361436
err_msg = "Failed to chmod/chown several paths.*No such file or directory"
14371437
self.assertRaisesRegex(EasyBuildError, err_msg, ft.adjust_permissions, nosuchdir, stat.S_IWOTH)
14381438
nosuchfile = os.path.join(self.test_prefix, 'nosuchfile')
1439-
self.assertRaisesRegex(EasyBuildError, err_msg, ft.adjust_permissions, nosuchfile, stat.S_IWUSR, recursive=False)
1439+
self.assertRaisesRegex(EasyBuildError, err_msg, ft.adjust_permissions,
1440+
nosuchfile, stat.S_IWUSR, recursive=False)
14401441

14411442
# try using adjust_permissions on a file not owned by current user,
14421443
# using permissions that are actually already correct;
@@ -1575,11 +1576,11 @@ def test_apply_regex_substitutions(self):
15751576
error_pat = "Nothing found to replace 'Not there' in %s" % testfile
15761577
# Error
15771578
self.assertRaisesRegex(EasyBuildError, error_pat, ft.apply_regex_substitutions, testfile, regex_subs_no_match,
1578-
on_missing_match=ERROR)
1579+
on_missing_match=ERROR)
15791580
# First matches, but 2nd not
15801581
regex_subs_part_match = [regex_subs[0], ('Not there', 'Not used')]
15811582
self.assertRaisesRegex(EasyBuildError, error_pat, ft.apply_regex_substitutions, testfile, regex_subs_part_match,
1582-
on_missing_match=ERROR, match_all=True)
1583+
on_missing_match=ERROR, match_all=True)
15831584
# First matched so OK with match_all
15841585
ft.apply_regex_substitutions(testfile, regex_subs_part_match,
15851586
on_missing_match=ERROR, match_all=False)
@@ -1846,9 +1847,9 @@ def test_create_patch_info(self):
18461847
self.assertRaisesRegex(EasyBuildError, error_msg, ft.create_patch_info, {'name': 'foo.txt'})
18471848
self.assertRaisesRegex(EasyBuildError, error_msg, ft.create_patch_info, {'name': 'foo.txt', 'random': 'key'})
18481849
self.assertRaisesRegex(EasyBuildError, error_msg, ft.create_patch_info,
1849-
{'name': 'foo.txt', 'copy': 'subdir', 'sourcepath': 'subdir'})
1850+
{'name': 'foo.txt', 'copy': 'subdir', 'sourcepath': 'subdir'})
18501851
self.assertRaisesRegex(EasyBuildError, error_msg, ft.create_patch_info,
1851-
{'name': 'foo.txt', 'copy': 'subdir', 'level': 1})
1852+
{'name': 'foo.txt', 'copy': 'subdir', 'level': 1})
18521853
self.assertRaisesRegex(EasyBuildError, error_msg, ft.create_patch_info, ('foo.patch', [1, 2]))
18531854
error_msg = "Unknown patch specification"
18541855
self.assertRaisesRegex(EasyBuildError, error_msg, ft.create_patch_info, ('foo.patch', 1, 'subdir'))
@@ -3974,7 +3975,7 @@ def test_create_unused_dir(self):
39743975
ft.adjust_permissions(readonly_dir, stat.S_IREAD | stat.S_IEXEC, relative=False)
39753976
try:
39763977
self.assertRaisesRegex(EasyBuildError, 'Failed to create directory',
3977-
ft.create_unused_dir, readonly_dir, 'new_folder')
3978+
ft.create_unused_dir, readonly_dir, 'new_folder')
39783979
finally:
39793980
ft.adjust_permissions(readonly_dir, old_perms, relative=False)
39803981

test/framework/github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,10 @@ def test_github_download_repo_commit(self):
656656

657657
# short commit doesn't work, must be full commit ID
658658
self.assertRaisesRegex(EasyBuildError, "Specified commit SHA bdcc586 .* is not valid", gh.download_repo,
659-
path=self.test_prefix, commit='bdcc586')
659+
path=self.test_prefix, commit='bdcc586')
660660

661661
self.assertRaisesRegex(EasyBuildError, "Failed to download tarball .* commit", gh.download_repo,
662-
path=self.test_prefix, commit='0000000000000000000000000000000000000000')
662+
path=self.test_prefix, commit='0000000000000000000000000000000000000000')
663663

664664
def test_install_github_token(self):
665665
"""Test for install_github_token function."""

test/framework/module_generator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def test_load(self):
316316
expected = "depends-on statements in generated module are not supported by modules tool"
317317
with self.mocked_stdout_stderr():
318318
self.assertRaisesRegex(EasyBuildError, expected,
319-
self.modgen.load_module, "mod_name", depends_on=True)
319+
self.modgen.load_module, "mod_name", depends_on=True)
320320
else:
321321
# default: guarded module load (which implies no recursive unloading)
322322
expected = '\n'.join([
@@ -362,7 +362,7 @@ def test_load(self):
362362
expected = "depends_on statements in generated module are not supported by modules tool"
363363
with self.mocked_stdout_stderr():
364364
self.assertRaisesRegex(EasyBuildError, expected,
365-
self.modgen.load_module, "mod_name", depends_on=True)
365+
self.modgen.load_module, "mod_name", depends_on=True)
366366

367367
def test_load_multi_deps(self):
368368
"""Test generated load statement when multi_deps is involved."""
@@ -776,7 +776,7 @@ def append_paths(*args, **kwargs):
776776

777777
self.assertRaisesRegex(EasyBuildError, "Absolute path %s/foo passed to update_paths "
778778
"which only expects relative paths." % self.modgen.app.installdir,
779-
append_paths, "key2", ["bar", "%s/foo" % self.modgen.app.installdir])
779+
append_paths, "key2", ["bar", "%s/foo" % self.modgen.app.installdir])
780780

781781
# check for warning that is printed when same path is added multiple times
782782
with self.modgen.start_module_creation():
@@ -910,7 +910,7 @@ def prepend_paths(*args, **kwargs):
910910

911911
self.assertRaisesRegex(EasyBuildError, "Absolute path %s/foo passed to update_paths "
912912
"which only expects relative paths." % self.modgen.app.installdir,
913-
prepend_paths, "key2", ["bar", "%s/foo" % self.modgen.app.installdir])
913+
prepend_paths, "key2", ["bar", "%s/foo" % self.modgen.app.installdir])
914914

915915
# check for warning that is printed when same path is added multiple times
916916
with self.modgen.start_module_creation():

0 commit comments

Comments
 (0)