unittest

Mag Gam magawake at gmail.com
Mon Aug 17 21:33:29 EDT 2009


all, thank you very much!!!

Now my question is, how do I simulate a argv? My program has take an
argv, like "foo.py File" is necessary. How and where do I put it in my
test? I suppose in the setUp(), but I am not sure how.

any thoughts or ideas?

TIA

On Sun, Aug 16, 2009 at 9:25 AM, Mag Gam<magawake at gmail.com> wrote:
> John:
>
> Well, this is actually a script which wraps around another application. :-)
> My goal is when I introduce a new feature I don't want to break old
> stuff so instead of me testing manually I want to build a framework of
> tests.
>
>
>
> On Sat, Aug 15, 2009 at 11:37 PM, John Haggerty<bouncyinc at gmail.com> wrote:
>> This is an interesting question. I am just wondering: do you really have
>> that many features that it would be impossible to just have a shell script
>> run specific types of input or tests?
>>
>> When I did programming in the past for education they just had lists of
>> input data and we ran the program against the test data.
>>
>> I just get slightly confused when "test suites" start to have to apply?
>>
>> On Fri, Aug 14, 2009 at 9:28 PM, Mag Gam <magawake at gmail.com> wrote:
>>>
>>> I am writing an application which has many command line arguments.
>>> For example: foo.py -args "bar bee"
>>>
>>> I would like to create a test suit using unittest so when I add
>>> features to "foo.py" I don't want to break other things. I just heard
>>> about unittest and would love to use it for this type of thing.
>>>
>>> so my question is, when I do these tests do I have to code them into
>>> foo.py? I prefer having a footest.py which will run the regression
>>> tests. Any thoughts about this?
>>>
>>> TIA
>>> --
>>> http://mail.python.org/mailman/listinfo/python-list
>>
>>
>



More information about the Python-list mailing list