[TIP] Testing executables/programs

Dirk Pranke dpranke at chromium.org
Tue Feb 26 16:59:39 PST 2019

At some point being able to more easily test command-line programs was one
of the goals of my "typ" package, so I have at least heard about such a
project :).

However, I never really got it to a point where I found that it was easier
than just adding scaffolding and fixtures into python unittest files as
needed. At least in my experience, you pretty quickly want to do things
like setting up the filesystem (or machine) into particular states, or
doing non-trivial parsing of the output of the command, and needing more
and more of a programming language.

So, I'd probably encourage you to just see if you can set up a similar
approach on top of pytest.

[ Side note: if you're reading this and thinking to yourself, "I've never
heard of this typ thing, I should check it out", it's a package used to
test a bunch of stuff for Chromium, but it's pretty idiosyncratically tied
to Chromium's testing infrastructure, and I wouldn't encourage you to look
at it. Use pytest instead :). ]

-- Dirk

On Tue, Feb 26, 2019 at 10:24 AM Zbigniew Reszela <reszelaz at gmail.com>

> 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/438bd42e/attachment.htm>

More information about the testing-in-python mailing list