Python unittest backend for Kyua
Craig Rodrigues
rodrigc at freebsd.org
Sat Feb 14 21:57:46 UTC 2015
On Tue, Nov 26, 2013 at 09:47:29PM -0700, Alan Somers wrote:
> I wrote a Kyua backend for Python programs that use the unittest
> module from the standard library. It's incomplete (no man page, no
> tests, no test case isolation, and no tested version of python other
> than 2.7), but I'm posting it to discuss the approach. Do you think
> it's a good start?
>
> Rather than use unittest's CLI, I wrote the backend to dynamically
> load the file under test and interrogate the test using unittest as a
> library. This allowed more intimate access. For example, the
> unittest CLI doesn't have a "list" command, but the backend can still
> list tests.
>
> Does it look good so far?
>
> -Alan
Alan,
I saw this post of yours from a while back.
I was just wondering, how far did you get with it? Do you use
it in your company?
I looked at three Python testing frameworks:
(1) unittest https://docs.python.org/2/library/unittest.html
(2) nose https://nose.readthedocs.org
(3) pytest http://pytest.org
I found that pytest was the easiest to set up and did what I needed:
-> test discovery
-> generate XML test result output compatible with Jenkins
-> tests do not need to inherit from any base classes,
and just requires a file with "test_*" methods
The test discovery makes it somewhat "kyua-like".
Do you have any opions/experience with this?
My experience is that running the FreeBSD tests in kyua work great.
However, for a full product, I've had a really hard time getting
QA people to be able to get comfortable writing new ATF tests and Kyuafiles.
I've had less problems withe the Python frameworks.
--
Craig
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-testing/attachments/20150214/1abedc24/attachment.sig>
More information about the freebsd-testing
mailing list