I had not tried taking the sys.argv statement out of my code. You are
correct: when using TestTextRunner, sys.argv does not need to be
cleaned. I like the idea of a command line flag. It's probably a good
idea to offer such a flag, even though it turns out it's not needed to
run unit tests.


On Feb 25, 2:49 pm, Thadeus Burgess <[email protected]> wrote:
> I do not like the idea of having to specify the name of the app twice,
> it breaks DRY.
>
> What about an additional command line flag that can tell whether to
> strip sys.argv or not. This will keep backwards compatibility, and
> also allow for scripts to have a simple sys.argv if required.
>
> web2py.py --clean-argv
>
> On this note, have you attempted to use unittest.TextTestRunner(...)
> without the sys.argv=sys.argv[5:]
>
> I believe that TextTestRunner should work since it shouldn't look at
> command line args.
>
> -Thadeus
>
> On Thu, Feb 25, 2010 at 1:37 PM, spiffytech <[email protected]> wrote:
> > ot know any reason as to why web2py passes along args that it is
> >> not using. However I think this could be beneficial in certain scripts
> >> that need to rely on certain parameters, like I have a backup script
> >> that relies on the app name, I can look at the -S arg to determine
> >> what app I am currently working on for this scr

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to