[TIP] system testing with Python

John Yeuk Hon Wong gokoproject at gmail.com
Sun Jan 26 11:35:08 PST 2014


I find testing sysmte/shell/command-line program pretty application 
specific.
Another option is pexecpt, though it may not does everything you want 
(it does a few nice trick that you otherwise would have to write 
yourself if you use subprocess).
http://pexpect.readthedocs.org/en/latest/api/pexpect.html

On 1/26/14 2:29 PM, Ian Cordasco wrote:
> So long as we're recommending shell frameworks for testing, my former
> coworker has an excellent one: https://github.com/rylnd/shpec It
> emulates rspec's syntax (if that's something you appreciate)
>
> On Sun, Jan 26, 2014 at 1:11 PM, Doug Hellmann <doug at doughellmann.com> wrote:
>> If you’re working with shell commands, a shell framework might be easier to use than something based on Python. I use shunit2 for testing virtualenvwrapper, for example.
>>
>> http://shunit.sourceforge.net/
>> https://code.google.com/p/shunit2/
>>
>> On Jan 26, 2014, at 1:43 PM, Alfredo Deza <alfredo at deza.pe> wrote:
>>
>>> I am searching for something in Python that will help in system testing. That is, run a command (or a few of them) and allow
>>> assertions on output or on exit status.
>>>
>>> I’m well aware though that I can do a few calls to subprocess and then inspect stdout/stderr for a match or check the exit status
>>> with that same object, but I was wondering if there is something out there that might help here.
>>>
>>> The use case is for tests that are done on a storage cluster, so several machines are brought up and a few commands are sent to the cluster with certain expectations, although most of the time we are looking for a non-zero exit status.
>>>
>>> I love py.test, so a plugin for it would be nice, although I wouldn’t mind looking at other things that might help with this kind of testing.
>>>
>>> Any ideas or example would be great!
>>>
>>>
>>> Thanks,
>>>
>>> Alfredo
>>> _______________________________________________
>>> testing-in-python mailing list
>>> testing-in-python at lists.idyll.org
>>> http://lists.idyll.org/listinfo/testing-in-python
>>
>> _______________________________________________
>> testing-in-python mailing list
>> testing-in-python at lists.idyll.org
>> http://lists.idyll.org/listinfo/testing-in-python
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python




More information about the testing-in-python mailing list