diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py index 1290cbc69f1..93d85f15d05 100644 --- a/tests/unittests/test_util.py +++ b/tests/unittests/test_util.py @@ -972,11 +972,17 @@ def test_is_lxd_false_when_sock_device_absent(self, m_exists): class TestReadCcFromCmdline: + if hasattr(pytest, "param"): + random_string = pytest.param( + CiTestCase.random_string(), None, id="random_string") + else: + random_string = (CiTestCase.random_string(), None) + @pytest.mark.parametrize( "cmdline,expected_cfg", [ # Return None if cmdline has no cc:end_cc content. - (CiTestCase.random_string(), None), + random_string, # Return None if YAML content is empty string. ('foo cc: end_cc bar', None), # Return expected dictionary without trailing end_cc marker.