File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1313
1414import pytest
1515import json
16- from os .path import sep as _sep , altsep as _altsep
1716import shutil
1817
1918from . import paths
20- from .compat import _PY2 as PY2
19+ from .compat import _PY2 as PY2 , Path
2120
2221README_CONTENT = u"""\
2322 # pytest cache directory #
@@ -62,14 +61,15 @@ def makedir(self, name):
6261 Make sure the name contains your plugin or application
6362 identifiers to prevent clashes with other cache users.
6463 """
65- if _sep in name or _altsep is not None and _altsep in name :
64+ name = Path (name )
65+ if len (name .parts ) > 1 :
6666 raise ValueError ("name is not allowed to contain path separators" )
6767 res = self ._cachedir .joinpath ("d" , name )
6868 res .mkdir (exist_ok = True , parents = True )
6969 return py .path .local (res )
7070
7171 def _getvaluepath (self , key ):
72- return self ._cachedir .joinpath ("v" , * key . split ( "/" ))
72+ return self ._cachedir .joinpath ("v" , Path ( key ))
7373
7474 def get (self , key , default ):
7575 """ return cached value for the given key. If no value
You can’t perform that action at this time.
0 commit comments