pytest-dev/pytest-splinter

AttributeError: 'function' object has no attribute 'ensure'

ionelmc opened this issue · 8 comments

I've tried to make a patch but I don't get why all those branches are there. Why is screenshot_dir recreated in certain conditions?

[gw1] linux2 -- Python 2.7.12 /usr/bin/python2.7
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pytest_splinter/plugin.py", line 522, in _take_screenshot_on_failure
    splinter_screenshot_getter_png=splinter_screenshot_getter_png,
  File "/usr/local/lib/python2.7/dist-packages/pytest_splinter/plugin.py", line 376, in _take_screenshot
    screenshot_dir = session_tmpdir.ensure('screenshots', dir=True).strpath
AttributeError: 'function' object has no attribute 'ensure'

good catch, session_tmpdir needs to be a parameter of that function and passed from the fixture session_tmpdir
which branches do you mean?

try 1.8.4

Branches as in if statements :)

the if is for xdist so when it's on remote node it needs to be created both on remote and local sides

sorry for making mess - 1.8.5 should work

@bubenkoff 1.8.5 ain't on pypi yet, upload failed?

sorry again - missed that, now it's there

No problem, thanks for the quick fixes :)