[ANN] PikoTest.py - a small testing library

Makoto Kuwata kwa at kuwata-lab.com
Sun Nov 13 19:27:35 EST 2011


I released PikoTest.py 0.1.0.
http://pypi.python.org/pypi/PicoTest

PikoTest.py is a samll testing library for Python.

Features:

* Structured Test
* Setup/Teardown
* Fixture Injection
* Skip Test
* TODO

Example::

    from __future__ import with_statement
    import picotest
    test = picotest.new()

    with test("type 'str'"):

        with test("operator '*'"):

            @test("repeats string N times.")
            def _(self):
                self.assertEqual("AAA", "A" * 3)

            @test("returns empty string when N is negative.")
            def _(self):
                self.assertEqual("", "A" * -1)

    if __name__ == '__main__':
        picotest.main()


Output example::

    $ python -m picotest -h        # show help
    $ python example_test.py       # or python -m picotest example_test.py
    #### example_test.py
    * type 'str'
      * operator '*'
        - [passed] repeats string N times.
        - [passed] returns empty string when N is negative.
    ## total:2, passed:2, failed:0, error:0, skipped:0, todo:0


See http://pypi.python.org/pypi/PicoTest for details.

--
regards,
makoto kuwata



More information about the Python-list mailing list