A script to run all of my project's pyunit tests

2005-08-19 Thread travislspencer
Hey All, I am trying to write a script that runs all of my pyunit tests for me. Ideally, I would like to be able to drop a new module into my project's test subdirectory, and the testing script will pick it up automatically. At the moment, I have it working but it is kinda a kludge because every

Re: A script to run all of my project's pyunit tests

2005-08-19 Thread travislspencer
[EMAIL PROTECTED] wrote: for file in glob(projHome + /tests/*.py): start = file.rfind(/) + 1 end = file.rfind(.) moduleName = file[start:end] module = __import__(moduleName) klass = module.__dict__[module.__name__] tests.append(unittest.makeSuite(klass, test))

Re: Filling up commands.getstatusoutput's buffer

2005-07-21 Thread travislspencer
Jeff Epler wrote: On Wed, Jul 20, 2005 at 03:10:49PM -0700, [EMAIL PROTECTED] wrote: How much output are you talking about? Honestly, I don't know. I came on to a project were they said they were hitting up against some limit, and had a hack to work around it. I just wondered if others had hit

Printing a variable's name not its value

2005-07-20 Thread travislspencer
Hey, I am trying to write a function that takes an arbitrary number of arguments and does one of two things. If the variable is a key in a dictionary, it prints the key and its value. Otherwise, if any of the variables isn't in the dictionary, the function prints the variable's name and value.

Re: Printing a variable's name not its value

2005-07-20 Thread travislspencer
Bruno Desthuilliers wrote: [EMAIL PROTECTED] a écrit : globals = {} globals() is a builtin function, you should no shadow it. Oh, woops. I'll fix that. def printVerbose(*args, **kwargs): if VERBOSE in globals: for a in args: if a in globals:

Re: Printing a variable's name not its value

2005-07-20 Thread travislspencer
Simon Dahlbacka wrote: as you have been told, there is no way to get a variable's name, take a look at http://effbot.org/zone/python-objects.htm to find out why this is so. Thanks, Simon, for the link. -- Regards, Travis Spencer -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing a variable's name not its value

2005-07-20 Thread travislspencer
[EMAIL PROTECTED] wrote: Bruno Desthuilliers wrote: def printVerbose(*args, **kwargs): if VERBOSE in globals: for a in args: if a in globals: value = globals[a] for k, v in kwargs.iteritems(): print %s: %s %

Filling up commands.getstatusoutput's buffer

2005-07-20 Thread travislspencer
Hey, Has anyone ever had commands.getstatusoutput's buffer fill up when executing a verbose command? If so, what workaround did you use? Did you just pipe the output into a file and then read it in or fork a processes or something else? -- Regards, Travis Spencer --