def _load_nested_example_groups(self, klass, example_group): for nested in self._example_groups_for(klass): if isinstance(example_group, PendingExampleGroup): nested_example_group = PendingExampleGroup(nested._example_name) else: nested_example_group = self._create_example_group(nested) nested_example_group.helpers = dict(example_group.helpers) self._add_hooks_examples_and_nested_example_groups_to(nested, nested_example_group) example_group.append(nested_example_group)
def _create_example_group(self, klass): name = self._description(klass) tags = self._tags_for(name) if '__pending' in klass.__name__: return PendingExampleGroup(name, tags=tags) return ExampleGroup(name, tags=tags)
def _create_example_group(self, klass): name = klass._example_name tags = klass._tags if klass._pending: return PendingExampleGroup(name, tags=tags) elif klass._shared: return SharedExampleGroup(name, tags=tags) return ExampleGroup(name, tags=tags)
def _load_nested_example_groups(self, klass, example_group): for nested in self._example_groups_for(klass): if isinstance(example_group, PendingExampleGroup): nested_example_group = PendingExampleGroup( self._description(nested)) else: nested_example_group = self._create_example_group(nested) self._add_hooks_examples_and_nested_example_groups_to( nested, nested_example_group) example_group.append(nested_example_group)
def _load_nested_example_groups(self, klass, example_group): for nested in self._example_groups_for(klass): if isinstance(example_group, PendingExampleGroup): nested_example_group = PendingExampleGroup( self._subject(nested), execution_context=example_group.execution_context) else: nested_example_group = self._create_example_group( nested, execution_context=example_group.execution_context) self._add_hooks_examples_and_nested_example_groups_to( nested, nested_example_group) example_group.append(nested_example_group)
def _create_example_group(self, klass, execution_context=None): if '__pending' in klass.__name__: return PendingExampleGroup(self._subject(klass), execution_context=execution_context) return ExampleGroup(self._subject(klass), execution_context=execution_context)
def a_pending_example_group(description=IRRELEVANT_DESCRIPTION): return PendingExampleGroup(IRRELEVANT_DESCRIPTION)
def a_pending_example_group(subject=IRRELEVANT_SUBJECT): return PendingExampleGroup(IRRELEVANT_SUBJECT)