File tree 1 file changed +5
-4
lines changed 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1121,26 +1121,27 @@ def get_common_ancestor(args):
1121
1121
return common_ancestor
1122
1122
1123
1123
def get_dirs_from_args (args ):
1124
- return [py .path .local (x ) for x in args if not str (x ).startswith ("-" )]
1124
+ return [d for d in (py .path .local (x ) for x in args if not
1125
+ str (x ).startswith ("-" )) if d .exists ()]
1125
1126
1126
1127
def determine_setup (inifile , args ):
1128
+ dirs = get_dirs_from_args (args )
1127
1129
if inifile :
1128
1130
iniconfig = py .iniconfig .IniConfig (inifile )
1129
1131
try :
1130
1132
inicfg = iniconfig ["pytest" ]
1131
1133
except KeyError :
1132
1134
inicfg = None
1133
- rootdir = get_common_ancestor (args )
1135
+ rootdir = get_common_ancestor (dirs )
1134
1136
else :
1135
- ancestor = get_common_ancestor (args )
1137
+ ancestor = get_common_ancestor (dirs )
1136
1138
rootdir , inifile , inicfg = getcfg (
1137
1139
[ancestor ], ["pytest.ini" , "tox.ini" , "setup.cfg" ])
1138
1140
if rootdir is None :
1139
1141
for rootdir in ancestor .parts (reverse = True ):
1140
1142
if rootdir .join ("setup.py" ).exists ():
1141
1143
break
1142
1144
else :
1143
- dirs = get_dirs_from_args (args )
1144
1145
rootdir , inifile , inicfg = getcfg (
1145
1146
dirs , ["pytest.ini" , "tox.ini" , "setup.cfg" ])
1146
1147
if rootdir is None :
You can’t perform that action at this time.
0 commit comments