diff --git a/ansible_testing/modules.py b/ansible_testing/modules.py index 721d4e1364..0572576714 100644 --- a/ansible_testing/modules.py +++ b/ansible_testing/modules.py @@ -498,6 +498,10 @@ class ModuleValidator(Validator): if self._python_module() and self.ast is None: self.errors.append('Python SyntaxError while parsing module') + try: + compile(self.text, self.path, 'exec') + except Exception as e: + self.traces.append(e) return if self._python_module():