diff --git a/tests/unit/plugins/modules/uthelper.py b/tests/unit/plugins/modules/uthelper.py index 625a79d8ff..ee930744ec 100644 --- a/tests/unit/plugins/modules/uthelper.py +++ b/tests/unit/plugins/modules/uthelper.py @@ -203,6 +203,12 @@ class TestCaseMock: def build_mock(cls, mock_specs): return cls(mock_specs) + def __str__(self): + return f"<{self.__class__.__name__} specs={self.mock_specs}>" + + def __repr__(self): + return f"{self.__class__.__name__}({self.mock_specs})" + def __init__(self, mock_specs): self.mock_specs = mock_specs @@ -219,12 +225,6 @@ class TestCaseMock: class RunCommandMock(TestCaseMock): name = "run_command" - def __str__(self): - return "".format(specs=self.mock_specs) - - def __repr__(self): - return "RunCommandMock({specs})".format(specs=self.mock_specs) - def fixtures(self): @pytest.fixture def patch_bin(mocker):