Skip to content

Commit

Permalink
Fixed pytest-dev#2149 - parse directory names properly when args cont…
Browse files Browse the repository at this point in the history
…ains ::.
  • Loading branch information
pelme committed Dec 20, 2016
1 parent 187b971 commit f56fd50
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions _pytest/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,9 +1257,13 @@ def get_common_ancestor(args):


def get_dirs_from_args(args):
return [d for d in (py.path.local(x) for x in args
if not str(x).startswith("-"))
if d.exists()]
possible_dirs = [
py.path.local(str(arg).split('::')[0])
for arg in args
if not str(arg).startswith('-')
]

return [d for d in possible_dirs if d.exists()]


def determine_setup(inifile, args, warnfunc=None):
Expand Down

0 comments on commit f56fd50

Please sign in to comment.