Skip to content

Commit 2c41dc8

Browse files
committed
Fix reported path when test-case file is not found
1 parent 0167612 commit 2c41dc8

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

easybuild/framework/easyblock.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4704,6 +4704,8 @@ def test_cases_step(self):
47044704
test_cmd = os.path.join(source_path, self.name, test)
47054705
if os.path.exists(test_cmd):
47064706
break
4707+
else:
4708+
test_cmd = test # Reset at and of loop
47074709
if not os.path.exists(test_cmd):
47084710
raise EasyBuildError(f"Test specifies non-existing path: {test_cmd}")
47094711

test/framework/easyblock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ def test_test_cases_step(self):
13341334
self.writeEC()
13351335
eb = EasyBlock(EasyConfig(self.eb_file))
13361336

1337-
self.assertErrorRegex(EasyBuildError, "non-existing path: .*example_test", eb.test_cases_step)
1337+
self.assertErrorRegex(EasyBuildError, "non-existing path: example_test", eb.test_cases_step)
13381338

13391339
test_file = os.path.join(new_source_path, 'pi', 'example_test')
13401340
write_file(test_file, '#!/bin/bash\nexit 1')

0 commit comments

Comments
 (0)