def test_hello_world(): """Simple test that asserts that the hello string is not empty.""" hello = 'hello, world' asserts.is_not_empty(hello)
def test_test_run_from_module(): module = sys.modules[__name__] run = test_run.TestRun.from_module(module) asserts.is_not_empty(run.tests) asserts.are_equal(run.name, 'test_run_test')
def test_test_suite_from_module(): module = sys.modules[__name__] suite = test_suite.TestSuite.from_module(module) asserts.is_not_empty(suite) asserts.are_equal(suite.name, 'test_suite_test')
def test_assert_not_empty_bad(collection): with asserts.expect_exception(AssertionError): asserts.is_not_empty(collection)
def test_assert_not_empty_ok(collection): asserts.is_not_empty(collection)