{"id":19680876,"url":"https://github.com/codewars/python-test-framework","last_synced_at":"2025-04-29T04:31:46.607Z","repository":{"id":40509605,"uuid":"170770716","full_name":"codewars/python-test-framework","owner":"codewars","description":"Codewars test framework for Python","archived":false,"fork":false,"pushed_at":"2023-07-28T20:14:20.000Z","size":24,"stargazers_count":63,"open_issues_count":9,"forks_count":22,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-04-14T11:04:39.786Z","etag":null,"topics":["code-runner","python","test-framework"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codewars.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-14T23:09:45.000Z","updated_at":"2024-02-18T02:58:13.000Z","dependencies_parsed_at":"2022-08-09T22:22:34.893Z","dependency_job_id":null,"html_url":"https://github.com/codewars/python-test-framework","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewars%2Fpython-test-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewars%2Fpython-test-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewars%2Fpython-test-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewars%2Fpython-test-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewars","download_url":"https://codeload.github.com/codewars/python-test-framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224151630,"owners_count":17264436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-runner","python","test-framework"],"created_at":"2024-11-11T18:06:21.124Z","updated_at":"2024-11-11T18:06:21.699Z","avatar_url":"https://github.com/codewars.png","language":"Python","readme":"# Codewars Test Framework for Python\n\n### Installation\n\n```bash\npip install git+https://github.com/codewars/python-test-framework.git#egg=codewars_test\n```\n\n### Basic Example\n\n```python\nimport codewars_test as test\nfrom solution import add\n\n@test.describe('Example Tests')\ndef example_tests():\n\n    @test.it('Example Test Case')\n    def example_test_case():\n        test.assert_equals(add(1, 1), 2, 'Optional Message on Failure')\n```\n\n\u003c!--\n\n### Using Other Assertions\n\n\u003e NOTE: This is not ready for production because the passed test case is not reported correctly.\n\u003e See [#9](https://github.com/codewars/python-test-framework/issues/9).\n\nAny function that raises an `AssertionError` can be used instead of `codewars_test` assertions:\n\n```python\nimport numpy as np\nimport pandas as pd\nimport codewars_test as test\n\n@test.describe('Example Tests')\ndef test_custom_assertions():\n\n    @test.it('Test something in numpy')\n    def test_numpy_assertion():\n        actual = np.reshape(range(16), [4, 4])\n        expected = np.reshape(range(16, 0, -1), [4, 4])\n        np.testing.assert_equal(expected, actual)\n\n    @test.it('Test something in pandas')\n    def test_pandas_assertion():\n        actual = pd.DataFrame({'foo': [1, 2, 3]})\n        expected = pd.DataFrame({'foo': [1, 42, 3]})\n        pd.testing.assert_frame_equal(expected, actual)\n\n    @test.it('Test something using a custom assertion')\n    def test_custom_assertion():\n        def custom_assert_eq(actual, expected, msg=None):\n            if actual != expected:\n                default_msg = f'`{actual}` did not equal expected `{expected}`'\n                raise AssertionError(default_msg if msg is None else msg)\n\n        actual = 2\n        expected = 1\n        custom_assert_eq(actual, expected)\n```\n\n--\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewars%2Fpython-test-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewars%2Fpython-test-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewars%2Fpython-test-framework/lists"}