Skip to content

Commit d61eb2a

Browse files
authored
Merge pull request #3530 from vkarak/bugfix/parameterize-equals
[bugfix] Treat `=` properly when parameterizing tests with `--parameterize`
2 parents abd5fad + 55d1ff4 commit d61eb2a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

reframe/frontend/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ def _case_failed(t):
13751375
params = {}
13761376
for param_spec in options.parameterize:
13771377
try:
1378-
var, values_spec = param_spec.split('=')
1378+
var, values_spec = param_spec.split('=', maxsplit=1)
13791379
except ValueError:
13801380
raise errors.CommandLineError(
13811381
f'invalid parameter spec: {param_spec}'

unittests/test_cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,16 +1061,16 @@ def test_repeat_negative(run_reframe):
10611061

10621062
def test_parameterize_tests(run_reframe):
10631063
returncode, stdout, _ = run_reframe(
1064-
more_options=['-P', 'num_tasks=2,4,8', '-n', '^HelloTest'],
1064+
more_options=['-P', 'descr=msg=hello1,msg=hello2',
1065+
'-n', '^HelloTest'],
10651066
checkpath=['unittests/resources/checks/hellocheck.py'],
10661067
action='describe'
10671068
)
10681069
assert returncode == 0
10691070

1070-
test_descr = json.loads(stdout)
1071-
print(json.dumps(test_descr, indent=2))
1072-
num_tasks = {t['num_tasks'] for t in test_descr}
1073-
assert num_tasks == {2, 4, 8}
1071+
test_json = json.loads(stdout)
1072+
descr = [t['descr'] for t in test_json]
1073+
assert descr == ['msg=hello1', 'msg=hello2']
10741074

10751075

10761076
def test_parameterize_tests_invalid_params(run_reframe):

0 commit comments

Comments
 (0)