[Tutor] Conventions for code snippets for debugging and testing?

Alan Gauld alan.gauld at btinternet.com
Fri Apr 11 01:30:54 CEST 2008


"Robert Kirkpatrick" <robertk at bcgsc.ca> wrote

> The use case I'm dealing with right now is to query the SVN commits 
> for a
> weekly period and report on each user for that time period.  If I'm 
> testing
> though, I only want to cycle through a few users, not all of them.

You could pass the values in as command line arguments which
are otherwise defaulted. Then to run the debug version create
a shell alias or even a shell script with the debig values and
another with the production values.

Or if there are several values store the values in a config file and
pass the name of the config file in as an argument.

Or you could use environment variables to point to the config file.
Or you could store the values as individual environment vars and
have a batch file set the values prior to debugging and another
to reset them for production.

Lots of options.

There is nothing Python specific about any of this its how debug
environments have been set up for decades.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list