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
2
2
3
3
import pytest
4
4
5
- mydir = py .path .local (__file__ ). dirpath ( )
5
+ mydir = os .path .dirname (__file__ )
6
6
7
7
8
8
def pytest_runtest_setup (item ):
Original file line number Diff line number Diff line change 1
- import py
1
+ import os .path
2
+ import shutil
2
3
3
- failure_demo = py .path .local ( __file__ ). dirpath ( "failure_demo.py" )
4
+ failure_demo = os .path .join ( os . path . dirname ( __file__ ), "failure_demo.py" )
4
5
pytest_plugins = ("pytester" ,)
5
6
6
7
7
8
def 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 )
11
11
result = testdir .runpytest (target , syspathinsert = True )
12
12
result .stdout .fnmatch_lines (["*44 failed*" ])
13
13
assert result .ret != 0
You can’t perform that action at this time.
0 commit comments