From 3845ea821fa2d39d758ae15ede158a126d40c775 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sun, 7 Nov 2010 17:37:40 +0100 Subject: [PATCH] avoid parsing of path objects when pytest.main(path) is called. --- pytest/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytest/main.py b/pytest/main.py index 840868a88..6a90bfbdf 100644 --- a/pytest/main.py +++ b/pytest/main.py @@ -410,9 +410,9 @@ _preinit = [PluginManager(load=True)] # triggers default plugin importing def main(args=None, plugins=None): if args is None: args = sys.argv[1:] + elif isinstance(args, py.path.local): + args = [str(args)] elif not isinstance(args, (tuple, list)): - if isinstance(args, py.path.local): - args = str(args) if not isinstance(args, str): raise ValueError("not a string or argument list: %r" % (args,)) args = py.std.shlex.split(args)