[TIP] Testing executables/programs

André Caron andre.l.caron at gmail.com
Tue Feb 26 11:57:32 PST 2019

Hi there,

I have found pexpect (https://pexpect.readthedocs.io/), in combination to
pytest to be quite useful for a similar case.

If you want to do something more fancy such as a DSL to write the example
inputs and outputs without writing Python code for each test, you might
want to take a look at "Working with non-python tests" in the pytest
documentation: https://docs.pytest.org/en/latest/example/nonpython.html.



On Tue, Feb 26, 2019 at 1:28 PM Zbigniew Reszela <reszelaz at gmail.com> wrote:

> Hi,
> I would like to write a generic test case in python (unittest, pytest,
> etc) for testing executables/programs (this can be python/C++/Java or
> whatever applications).
> So, I would need to pass command line arguments for the progam execution,
> and maybe sometimes need to terminate the applications under test
> programmatically e.g. if these are GUI apps. Ideally this generic test case
> should be easilly parametrizable to just pass a list of strings (program
> name and arguments). The asserts could be on the exit codes or the stderr
> stream.
> The motivation behind this is to have a *cheap* way to smoke test a bunch
> of our project.
> I googled a little bit if there is already something existing but without
> success. Have you heared about such a project?
> Any comments on that would be appreciated.
> --
> Best regards,
> Zibi
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20190226/17cb5950/attachment.htm>

More information about the testing-in-python mailing list