From 47141cd477254abcb2a15cdf7e72bdb97da29f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Sun, 7 Aug 2022 10:47:26 +0200 Subject: [PATCH] Revert "Merge pull request #157 from SunilMohanAdapa/fix-session-browser-screenshots" This reverts commit 6c741bed284f5b776c5be893b7bb0bc6feccad18, reversing changes made to 2446326e5c8b8ce49e93f217bcbcb87c18c14287. --- pytest_splinter/plugin.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pytest_splinter/plugin.py b/pytest_splinter/plugin.py index b1c8c9e..88fd003 100644 --- a/pytest_splinter/plugin.py +++ b/pytest_splinter/plugin.py @@ -467,8 +467,15 @@ def _browser_screenshot_session( if not splinter_session_scoped_browser: return - for name in request.fixturenames: - value = request.getfixturevalue(name) + fixture_values = ( + # pytest 3 + getattr(request, "_fixture_values", {}) + or + # pytest 2 + getattr(request, "_funcargs", {}) + ) + + for name, value in fixture_values.items(): should_take_screenshot = ( hasattr(value, "__splinter_browser__") and splinter_make_screenshot_on_failure