siebenschlaefer
5/9/2016 - 5:14 PM

Cheat Sheet for the Codewars Python Test Framework

Cheat Sheet for the Codewars Python Test Framework

# https://github.com/Codewars/codewars.com/wiki/Codewars-Python-Test-Framework-V2

@test.describe('Example Tests')
def f():
    @test.it('Example Test Case')
    def f():
        test.assert_equals("actual", "expected", "optional_message")
        test.assert_not_equals("actual", "expected", "optional_message")
        test.assert_approx_equals("actual", "expected", optional_margin, "optional_message)
        test.expect("truthy", "optional_message")
        test.expect_error("message", lambda: 1/0, optional_expected_exception_base_class)