mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-13 15:35:08 +00:00
[PR #11095/2b4333a0 backport][stable-12] Use raise from in plugins (#11129)
Use raise from in plugins (#11095)
* Use raise from.
* Add changelog fragment.
(cherry picked from commit 2b4333a033)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
cddb570e0e
commit
cc93dab0fd
46 changed files with 218 additions and 165 deletions
|
|
@ -151,8 +151,8 @@ class ModuleTestCase:
|
|||
for mock_name, mock_spec in self.mock_specs.items():
|
||||
try:
|
||||
mock_class = mocks_map[mock_name]
|
||||
except KeyError:
|
||||
raise Exception(f"Cannot find TestCaseMock class for: {mock_name}")
|
||||
except KeyError as e:
|
||||
raise Exception(f"Cannot find TestCaseMock class for: {mock_name}") from e
|
||||
self.mocks[mock_name] = mock_class.build_mock(mock_spec)
|
||||
|
||||
self._fixtures.update(self.mocks[mock_name].fixtures())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue