pytest-dev/pytest-splinter

Screenshot is broken in latest release

ionelmc opened this issue · 2 comments

Problem fixture is not used properly (the function definition from global scope is used instead):

Traceback (most recent call last):
  File "/home/ci/.virtualenvs/3683c16e06ef68da57a4e65b87bf8940/local/lib/python2.7/site-packages/pytest_splinter/plugin.py", line 515, in _take_screenshot_on_failure
    splinter_screenshot_getter_png=splinter_screenshot_getter_png,
  File "/home/ci/.virtualenvs/3683c16e06ef68da57a4e65b87bf8940/local/lib/python2.7/site-packages/pytest_splinter/plugin.py", line 369, in _take_screenshot
    screenshot_dir = session_tmpdir.ensure('screenshots', dir=True).strpath
AttributeError: 'function' object has no attribute 'ensure'

Likely cause of regression is 21de5e4 (code being moved out from the function that had the proper fixture in its closure)

should be solved in latest release