[ANN] Oktest 0.3.0 released - a new style testing library

Discussion in 'Python' started by kwatch, May 16, 2010.

  1. kwatch

    kwatch Guest

    Hi,
    I released Oktest 0.3.0.

    http://packages.python.org/Oktest/
    http://pypi.python.org/pypi/Oktest/


    Overview
    --------

    Oktest is a new-style testing library for Python.
    ::

    from oktest import ok
    ok (x) > 0 # same as assert_(x > 0)
    ok (s) == 'foo' # same as assertEqual(s, 'foo')
    ok (s) != 'foo' # same as assertNotEqual(s, 'foo')
    ok (f).raises(ValueError) # same as assertRaises(ValueError, f)
    ok (u'foo').is_a(unicode) # same as assert_(isinstance(u'foo',
    unicode))
    not_ok (u'foo').is_a(int) # same as assert_(not
    isinstance(u'foo', int))
    ok ('A.txt').is_file() # same as
    assert_(os.path.isfile('A.txt'))
    not_ok ('A.txt').is_dir() # same as assert_(not
    os.path.isdir('A.txt'))

    You can use ok() instead of 'assertXxx()' in unittest.

    Oktest requires Python 2.3 or later. Oktest is ready for Python 3.

    NOTICE!! Oktest is a young project and specification may change in the
    future.

    See http://packages.python.org/Oktest/ for details.


    Changes
    -------

    * enhanced 'ok (s1) == s2' to display unified diff (diff -u)
    * changed to call 'before()/after()' instead of 'before_each()/
    after_each()'
    (currently 'before_each()/after_each()' is also enabled but they
    will be
    disabled in the future)
    * improved compatibility with unittest module
    * (internal) 'ValueObject' class is renamed to 'AssertionObject'
    * (internal) 'Reporter#before_each()' and '#after_each()' are renamed
    into
    '#before()' and '#after()'


    Have fun!

    --
    regards,
    makoto kuwata
     
    kwatch, May 16, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kwatch
    Replies:
    0
    Views:
    287
    kwatch
    Apr 19, 2010
  2. Makoto Kuwata
    Replies:
    0
    Views:
    284
    Makoto Kuwata
    Jun 27, 2010
  3. Makoto Kuwata
    Replies:
    0
    Views:
    203
    Makoto Kuwata
    Jan 23, 2011
  4. Makoto Kuwata
    Replies:
    0
    Views:
    190
    Makoto Kuwata
    Feb 15, 2011
  5. Makoto Kuwata
    Replies:
    0
    Views:
    162
    Makoto Kuwata
    Aug 27, 2011
Loading...

Share This Page