[py-dev] Re: [py-svn] r24998 - py/dist/py/test
Carl Friedrich Bolz
cfbolz at gmx.de
Sun Mar 26 14:38:52 CEST 2006
Brian Dorsey wrote:
> On 25/03/06, cfbolz at codespeak.net <cfbolz at codespeak.net> wrote:
>>Date: Sat Mar 25 16:34:53 2006
>>New Revision: 24998
>>make driving py.test programmatically easier, by allowing to not use sys.argv.
>>User feature request.
> I like this idea, but I wonder if it a bit less magic to expect a list
> of args rather than splitting a string in main()? That way it would be
> easy to modify an existing copy of sys.argv or use the args from
> another option parsing library (like optparse) as well.
Huh? But a list or args works too, no?
if args is None:
args = py.std.sys.argv[1:]
elif isinstance(args, basestring):
args = args.split(" ")
config, args = py.test.Config.parse(args)
If args is a list it is passed unchanched to parse. I agree that
splitting a string is maybe too magical.
More information about the Pytest-dev