Skip to main content

a new-style testing library

Project description

Oktest is a new-style testing library.

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', ode))
not_ok (u'foo').is_a(int)  # same as assert_(not isinstance(u'foo', )
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 README for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Oktest-0.2.2.tar.gz (10.9 kB view hashes)

Uploaded Source

Built Distributions

Oktest-0.2.2-py2.6.egg (12.6 kB view hashes)

Uploaded Source

Oktest-0.2.2-py2.5.egg (12.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page