GitPedia

Python test framework

Codewars test framework for Python

From codewars·Updated May 26, 2026·View on GitHub·

NOTE: This is not ready for production because the passed test case is not reported correctly. > See [#9](https://github.com/codewars/python-test-framework/issues/9). The project is written primarily in Python, distributed under the MIT License license, first published in 2019. Key topics include: code-runner, python, test-framework.

Latest release: v0.2.1

Codewars Test Framework for Python

Installation

bash
pip install git+https://github.com/codewars/python-test-framework.git#egg=codewars_test

Basic Example

python
import codewars_test as test from solution import add @test.describe('Example Tests') def example_tests(): @test.it('Example Test Case') def example_test_case(): test.assert_equals(add(1, 1), 2, 'Optional Message on Failure')
<!-- ### Using Other Assertions > NOTE: This is not ready for production because the passed test case is not reported correctly. > See [#9](https://github.com/codewars/python-test-framework/issues/9). Any function that raises an `AssertionError` can be used instead of `codewars_test` assertions: ```python import numpy as np import pandas as pd import codewars_test as test @test.describe('Example Tests') def test_custom_assertions(): @test.it('Test something in numpy') def test_numpy_assertion(): actual = np.reshape(range(16), [4, 4]) expected = np.reshape(range(16, 0, -1), [4, 4]) np.testing.assert_equal(expected, actual) @test.it('Test something in pandas') def test_pandas_assertion(): actual = pd.DataFrame({'foo': [1, 2, 3]}) expected = pd.DataFrame({'foo': [1, 42, 3]}) pd.testing.assert_frame_equal(expected, actual) @test.it('Test something using a custom assertion') def test_custom_assertion(): def custom_assert_eq(actual, expected, msg=None): if actual != expected: default_msg = f'`{actual}` did not equal expected `{expected}`' raise AssertionError(default_msg if msg is None else msg) actual = 2 expected = 1 custom_assert_eq(actual, expected) ``` -->

Contributors

Showing top 7 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from codewars/python-test-framework via the GitHub API.Last fetched: 6/19/2026