Skip to content

Codewars Python Test Framework

kazk edited this page Aug 30, 2017 · 17 revisions

Basic Setup

test.describe("Example Tests")
test.it("Example Test Case")
test.assert_equals(add(1, 1), 2, "Optional Message")

Assertions

TODO Improve the descriptions while keeping them simple.

test.assert_equals(actual, expected, message)

Checks that the actual value equals the expected value.

test.assert_not_equals(actual, unexpected, message)

Checks that the actual value does not equal the expected value.

test.expect_error(message, function)

Checks that function throws`.

test.expect(passed, message)

Checks that passed is truthy.

Clone this wiki locally