logassert v6

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

logassert v6

Facundo Batista-2
logassert is a simple log assertion mechanism for Python unittests.

Why? As is vox populi, you must also test the logging calls in your
programs. With logassert this is now very easy.

In this version:

- Simple way to check that nothing was logged (on any level or a specific one):

    assert NOTHING in logs.debug

- Helper to check that several lines were logged one after the other:

    assert Sequence(
        "Got 1 error and \d+ warnings:",
        Exact("  error: bar"),
    ) in logs.debug

- Show proper message when "not in" assertion is used (thanks Diego Mascialino)


.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org.ar/
Twitter: @facundobatista
Python-announce-list mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Member address: [hidden email]