From 7479c4c24f366bc745c3baa6e9a8032013958a2e Mon Sep 17 00:00:00 2001 From: Erik Marty Date: Sat, 25 Jan 2020 09:43:01 -0500 Subject: [PATCH] Adding patch for error AttributeError: 'NoneType' object has no attribute 'afters' (fixes #216) Issue occurs when using allure-python with pytest-selenium when passing the selenium argument (as main driver according to pytest-selenium library) --- allure-python-commons/src/reporter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/allure-python-commons/src/reporter.py b/allure-python-commons/src/reporter.py index 1932f2e3..60e9bacd 100644 --- a/allure-python-commons/src/reporter.py +++ b/allure-python-commons/src/reporter.py @@ -57,8 +57,11 @@ def stop_before_fixture(self, uuid, **kwargs): self._items.pop(uuid) def start_after_fixture(self, parent_uuid, uuid, fixture): - self._items.get(parent_uuid).afters.append(fixture) - self._items[uuid] = fixture + try: + self._items.get(parent_uuid).afters.append(fixture) + self._items[uuid] = fixture + except: + self._items[uuid] = fixture def stop_after_fixture(self, uuid, **kwargs): self._update_item(uuid, **kwargs)