File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1- import py
1+ import os . path
22
33import pytest
44
5- mydir = py .path .local (__file__ ). dirpath ( )
5+ mydir = os .path .dirname (__file__ )
66
77
88def pytest_runtest_setup (item ):
Original file line number Diff line number Diff line change 1- import py
1+ import os .path
2+ import shutil
23
3- failure_demo = py .path .local ( __file__ ). dirpath ( "failure_demo.py" )
4+ failure_demo = os .path .join ( os . path . dirname ( __file__ ), "failure_demo.py" )
45pytest_plugins = ("pytester" ,)
56
67
78def test_failure_demo_fails_properly (testdir ):
8- target = testdir .tmpdir .join (failure_demo .basename )
9- failure_demo .copy (target )
10- failure_demo .copy (testdir .tmpdir .join (failure_demo .basename ))
9+ target = testdir .tmpdir .join (os .path .basename (failure_demo ))
10+ shutil .copy (failure_demo , target )
1111 result = testdir .runpytest (target , syspathinsert = True )
1212 result .stdout .fnmatch_lines (["*44 failed*" ])
1313 assert result .ret != 0
You can’t perform that action at this time.
0 commit comments