Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ These people have contributed to `pytest-splinter`, in alphabetical order:
* `Daniel Hahler <github@thequod.de>`_
* `Laurence Rowe <l@lrowe.co.uk>`_
* `Marco Buccini <markon@github.com>`_
* `Oleg Pidsadnyi <oleg.pidsadnyi@gmail.com>`_
* `Peter Lauri <peterlauri@gmail.com>`_
* `Suresh V <sureshvv@github.com>`_
* `Tomáš Ehrlich <tomas.ehrlich@gmail.com>`_
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

1.7.2
-----

- fixed taking a screenshot with pytest>=2.9.0 (olegpidsadnyi)


1.7.1
-----

Expand Down
2 changes: 1 addition & 1 deletion pytest_splinter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""pytest-splinter package."""
__version__ = '1.7.1'
__version__ = '1.7.2'
12 changes: 10 additions & 2 deletions pytest_splinter/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from httplib import HTTPException
except ImportError:
from http.client import HTTPException
import logging
import mimetypes # pragma: no cover
import os.path
import re
Expand All @@ -26,7 +27,7 @@
from .splinter_patches import patch_webdriverelement # pragma: no cover
from .decorators import with_fixtures

import logging

LOGGER = logging.getLogger(__name__)


Expand Down Expand Up @@ -387,6 +388,8 @@ def get_browser(splinter_webdriver, retry_count=3):

def prepare_browser(request, parent):
splinter_webdriver = request.getfuncargvalue('splinter_webdriver')
splinter_session_scoped_browser = request.getfuncargvalue('splinter_session_scoped_browser')
splinter_close_browser = request.getfuncargvalue('splinter_close_browser')
browser_key = id(parent)
browser = browser_pool.get(browser_key)
if not splinter_session_scoped_browser:
Expand Down Expand Up @@ -438,7 +441,12 @@ def browser_screenshot(
browser = value
if splinter_make_screenshot_on_failure and request.node.splinter_failure:
slaveoutput = getattr(request.config, 'slaveoutput', None)
names = junitxml.mangle_testnames(request.node.nodeid.split("::"))
try:
names = junitxml.mangle_testnames(request.node.nodeid.split("::"))
except AttributeError:
# pytest>=2.9.0
names = junitxml.mangle_test_address(request.node.nodeid)

classname = '.'.join(names[:-1])
screenshot_dir = os.path.join(splinter_screenshot_dir, classname)
screenshot_file_name_format = '{0}-{1}.{{format}}'.format(
Expand Down
2 changes: 1 addition & 1 deletion requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pytest-cov
pytest-localserver
pylama
pylama_pylint
astroid==1.3.6
astroid>=1.4.5