diff --git a/mamba/example_group.py b/mamba/example_group.py index dbd8107..bf3ab0a 100644 --- a/mamba/example_group.py +++ b/mamba/example_group.py @@ -37,8 +37,10 @@ def _start(self, reporter): reporter.example_group_started(self) def _register_subject_creation_in_before_each_hook(self): - if self._can_create_subject(): - self._hooks['before_each'].insert(0, lambda execution_context: self._create_subject(execution_context)) + if not self._can_create_subject(): + return + + self._hooks['before_each'].insert(0, lambda execution_context: self._create_subject(execution_context)) def _can_create_subject(self): return self._subject_is_class()