File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def getbasetemp(self):
56
56
# make_numbered_dir() call
57
57
import getpass
58
58
temproot = py .path .local .get_temproot ()
59
- rootdir = temproot .join ('pytest-%s' % getpass .getuser ())
59
+ rootdir = temproot .join ('pytest-of- %s' % getpass .getuser ())
60
60
rootdir .ensure (dir = 1 )
61
61
basetemp = py .path .local .make_numbered_dir (prefix = 'pytest-' ,
62
62
rootdir = rootdir )
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ def test_1(tmpdir):
95
95
result = testdir .runpytest ("-s" , p , '--basetemp=%s/bt' % linktemp )
96
96
assert not result .ret
97
97
98
+
98
99
def test_tmpdir_too_long_on_parametrization (testdir ):
99
100
testdir .makepyfile ("""
100
101
import pytest
@@ -104,3 +105,16 @@ def test_some(arg, tmpdir):
104
105
""" )
105
106
reprec = testdir .inline_run ()
106
107
reprec .assertoutcome (passed = 1 )
108
+
109
+
110
+ def test_tmpdir_factory (testdir ):
111
+ testdir .makepyfile ("""
112
+ import pytest
113
+ @pytest.fixture(scope='session')
114
+ def session_dir(tmpdir_factory):
115
+ return tmpdir_factory.mktemp('data', numbered=False)
116
+ def test_some(session_dir):
117
+ session_dir.isdir()
118
+ """ )
119
+ reprec = testdir .inline_run ()
120
+ reprec .assertoutcome (passed = 1 )
You can’t perform that action at this time.
0 commit comments