{"id":13772772,"url":"https://github.com/dannysepler/pytestify","last_synced_at":"2026-02-25T08:13:46.089Z","repository":{"id":37937550,"uuid":"385409707","full_name":"dannysepler/pytestify","owner":"dannysepler","description":"Automatically convert unittests to pytest","archived":false,"fork":false,"pushed_at":"2026-02-23T17:22:15.000Z","size":86,"stargazers_count":59,"open_issues_count":10,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-24T00:50:18.869Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dannysepler.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-07-12T23:21:40.000Z","updated_at":"2025-11-16T17:37:20.000Z","dependencies_parsed_at":"2023-02-16T10:46:14.569Z","dependency_job_id":"752cc041-58b8-4c0a-8665-8348e317cd32","html_url":"https://github.com/dannysepler/pytestify","commit_stats":{"total_commits":70,"total_committers":5,"mean_commits":14.0,"dds":0.2142857142857143,"last_synced_commit":"7d9337b68f86beeb3f45fa4f6de7d060f349dd58"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/dannysepler/pytestify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dannysepler%2Fpytestify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dannysepler%2Fpytestify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dannysepler%2Fpytestify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dannysepler%2Fpytestify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dannysepler","download_url":"https://codeload.github.com/dannysepler/pytestify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dannysepler%2Fpytestify/sbom","scorecard":{"id":321469,"data":{"date":"2025-08-11","repo":{"name":"github.com/dannysepler/pytestify","commit":"bee94a399074927f55a034a84b7987474dd9c9c8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/21 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/dannysepler/pytestify/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/dannysepler/pytestify/ci.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:30","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T01:27:33.771Z","repository_id":37937550,"created_at":"2025-08-18T01:27:33.771Z","updated_at":"2025-08-18T01:27:33.771Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29815020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-08-03T17:01:07.629Z","updated_at":"2026-02-25T08:13:46.052Z","avatar_url":"https://github.com/dannysepler.png","language":"Python","readme":"pytestify\n=========\n\n[![alt](http://img.shields.io/pypi/v/pytestify.svg)](https://pypi.python.org/pypi/pytestify)\n[![alt](https://img.shields.io/conda/vn/conda-forge/pytestify.svg)](https://anaconda.org/conda-forge/pytestify)\n\nA tool to automatically change unittest to pytest. Similar to\n[unittest2pytest](https://github.com/pytest-dev/unittest2pytest),\nbut with a few more features and written using AST and tokenize, rather\nthan lib2to3.\n\nBig thanks to [pyupgrade](https://github.com/asottile/pyupgrade/), which\nthis project has learned from.\n\n## Installation\n\n`pip install pytestify`\n\n## Usage\n\n`pytestify path/to/file.py`\n\nor\n\n`pytestify path/to/folder/`\n\n**Optional arguments**\n\n- [--keep-method-casing](#camelCase-to-snake_case)\n- [--with-count-equal](#assertCountEqual)\n\nPlease read over all changes that pytestify makes. It's a new\npackage, so there are bound to be issues.\n\n## Implemented features\n\n### Test class names\n\nRemove `TestCase` parent class, and make sure tests start with `Test`. We are keeping the test classes themselves, but you can remove them manually.\n\n```python\nclass TestThing(unittest.TestCase):  # class TestThing:\nclass TestThing(TestCase, ClassB):   # class TestThing(ClassB):\nclass ThingTest(unittest.TestCase):  # class TestThing:\nclass Thing(unittest.TestCase):      # class TestThing:\n```\n\n### Setup / teardowns\n\n```python\ndef setUp(self):          # def setup_method(self):\ndef tearDown(self):       # def teardown_method(self):\ndef setUpClass(self):     # def setup_class(self):\ndef tearDownClass(self):  # def teardown_class(self):\n```\n\n### Asserts\n\nRewrite unittest assert methods using the `assert` keyword.\n\n```python\n# asserting one thing\nself.assertTrue(a)       # assert a\nself.assertFalse (a)     # assert not a\nself.assertIsNone(a)     # assert a is None\nself.assertIsNotNone(a)  # assert a is not None\n\n# asserting two things\nself.assertEqual(a, b)      # assert a == b\nself.assertNotEqual(a, b)   # assert a != b\nself.assertIs(a, b)         # assert a is b\nself.assertIsNot(a, b)      # assert a is not b\nself.assertIn(a, b)         # assert a in b\nself.assertNotIn(a, b)      # assert a not in b\nself.assertListEqual(a, b)  # assert a == b\nself.assertDictEqual(a, b)  # assert a == b\nself.assertSetEqual(a, b)   # assert a == b\nself.assertGreater(a, b)    # assert a \u003e b\nself.assertLess(a, b)       # assert a \u003c b\nself.assertGreaterEqual(a, b)  # assert a \u003e= b\nself.assertLessEqual(a, b)  # assert a \u003c= b\nself.assertRegex(a, b)      # assert a.search(b)\nself.assertNotRegex(a, b)   # assert not a.search(b)\n\nself.assertAlmostEqual(a, b)\n#   assert a == pytest.approx(b)\nself.assertAlmostEqual(a, b, places=2)\n#   assert a == pytest.approx(b, abs=0.01)\nself.assertAlmostEquals(a, b, delta=2)\n#   assert a == pytest.approx(b, abs=2)\n\n\n# improves the assert if reasonable\nself.assertEqual(a, None)   # assert a is None\nself.assertEqual(a, True)   # assert a is True\n\n\n# error messages\nself.assertTrue(a, msg='oh no!')  # assert a, 'oh no!'\n```\n\n### Multi-line asserts\n\nSince `assert (a == b, 'err')`  is equivalent to asserting a tuple, and thus is always `True`.\n\n```python\nself.assertEqual(    # assert a == \\\n    a,               #     b\n    b,\n)\n\nself.assertEqual(    # assert a == \\\n    a,               #     b, \\\n    b,               #     'oh no!'\n    msg='oh no!'\n)\n```\n\n\n### camelCase to snake_case\n\nDisable this behavior with `--keep-method-casing`\n\n```python\ndef testThing(self):      # def test_thing(self):\ndef testHTTPThing(self):  # def test_httpthing(self):\n```\n\n### assertCountEqual\n\nThe `assertCountEqual` rewrite is risky, so opt-in with `pytest path/to/file --with-count-equal`.\n\n```python\nself.assertItemsEqual(a, b)  # assert sorted(a) == sorted(b)\nself.assertCountEqual(a, b)  # assert sorted(a) == sorted(b)\n```\n\nNote that pytest has no version of either of these methods. See\n[this thread](https://github.com/pytest-dev/pytest/issues/5548) for more\ninformation. You can also use\n[unittest's implementation](https://stackoverflow.com/a/45946306).\n\n### Exceptions\n\n```python\nself.assertRaises(OSError)             # pytest.raises(OSError)\nself.assertWarns(OSError)              # pytest.warns(OSError)\nwith self.assertRaises(OSError) as e:  # with pytest.raises(OSError) as e\nwith self.assertWarns(OSError) as e:   # with pytest.warns(OSError) as e\n```\n\n### Skipping / Expecting failure\n\n```python\n# decorated\n@unittest.skip('some reason')    # @pytest.mark.skip('some reason')\n@unittest.skipIf(some_bool)      # @pytest.mark.skipif(some_bool)\n@unittest.skipUnless(some_bool)  # @pytest.mark.skipif(not some_bool)\n@unittest.expectedFailure        # @pytest.mark.xfail\n\n# not decorated\nunittest.skip('some reason')     # pytest.skip('some reason')\nunittest.skipTest('some reason') # pytest.skip('some reason')\nunittest.fail('some reason')     # pytest.fail('some reason')\n```\n","funding_links":[],"categories":["Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannysepler%2Fpytestify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdannysepler%2Fpytestify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannysepler%2Fpytestify/lists"}