{"id":13636415,"url":"https://github.com/isidentical/teyit","last_synced_at":"2025-08-02T03:09:22.291Z","repository":{"id":42481115,"uuid":"299678416","full_name":"isidentical/teyit","owner":"isidentical","description":"Formatter for your Python unit tests ","archived":false,"fork":false,"pushed_at":"2022-10-29T13:39:34.000Z","size":32,"stargazers_count":105,"open_issues_count":10,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-07-11T03:52:20.403Z","etag":null,"topics":[],"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/isidentical.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-29T16:42:07.000Z","updated_at":"2025-02-23T09:41:25.000Z","dependencies_parsed_at":"2023-01-20T01:32:13.703Z","dependency_job_id":null,"html_url":"https://github.com/isidentical/teyit","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/isidentical/teyit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isidentical%2Fteyit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isidentical%2Fteyit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isidentical%2Fteyit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isidentical%2Fteyit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isidentical","download_url":"https://codeload.github.com/isidentical/teyit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isidentical%2Fteyit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268330911,"owners_count":24233151,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-02T00:01:01.034Z","updated_at":"2025-08-02T03:09:22.253Z","avatar_url":"https://github.com/isidentical.png","language":"Python","readme":"# Teyit\n\nAn analyzer / formatter for your Python unit tests (more specifically, the tests written with the `unittest` module).\n\n## Usage\n\n```\nusage: teyit [-h] [--pattern PATTERN] [--show-stats] [--fail-on-change] [paths ...]\n\npositional arguments:\n  paths\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --pattern PATTERN  Wildcard pattern for capturing test files.\n  --show-stats       Print out some debug stats related about refactorings\n  --fail-on-change   Exit with status code 1 if any file changed\n```\n\n### Pre-commit Hook\n\n```yaml\n-   repo: https://github.com/isidentical/teyit\n    rev: 0.4.3\n    hooks:\n    -   id: teyit\n```\n\n## Examples\n\nHere are some examples from CPython's test suite:\n\n```diff\n--- a/Lib/test/test_telnetlib.py\n+++ b/Lib/test/test_telnetlib.py\n@@ -48,7 +48,7 @@ def testContextManager(self):\n         self.assertIsNone(tn.get_socket())\n\n     def testTimeoutDefault(self):\n-        self.assertTrue(socket.getdefaulttimeout() is None)\n+        self.assertIsNone(socket.getdefaulttimeout())\n         socket.setdefaulttimeout(30)\n         try:\n             telnet = telnetlib.Telnet(HOST, self.port)\n@@ -215,7 +215,7 @@ def test_read_some(self):\n         # test 'at least one byte'\n         telnet = test_telnet([b'x' * 500])\n         data = telnet.read_some()\n-        self.assertTrue(len(data) \u003e= 1)\n+        self.assertGreaterEqual(len(data), 1)\n         # test EOF\n         telnet = test_telnet()\n         data = telnet.read_some()\n```\n\n```diff\n--- a/Lib/test/test___future__.py\n+++ b/Lib/test/test___future__.py\n@@ -13,8 +13,9 @@ def test_names(self):\n         for name in dir(__future__):\n             obj = getattr(__future__, name, None)\n             if obj is not None and isinstance(obj, __future__._Feature):\n-                self.assertTrue(\n-                    name in given_feature_names,\n+                self.assertIn(\n+                    name,\n+                    given_feature_names,\n                     \"%r should have been in all_feature_names\" % name\n                 )\n                 given_feature_names.remove(name)\n```\n\n```diff\n--- a/Lib/test/test_abc.py\n+++ b/Lib/test/test_abc.py\n@@ -321,14 +321,14 @@ class A(metaclass=abc_ABCMeta):\n             class B:\n                 pass\n             b = B()\n-            self.assertFalse(isinstance(b, A))\n-            self.assertFalse(isinstance(b, (A,)))\n+            self.assertNotIsInstance(b, A)\n+            self.assertNotIsInstance(b, (A,))\n```\n\n```diff\n--- a/Lib/test/test_bigmem.py\n+++ b/Lib/test/test_bigmem.py\n@@ -536,25 +536,25 @@ def test_contains(self, size):\n         edge = _('-') * (size // 2)\n         s = _('').join([edge, SUBSTR, edge])\n         del edge\n-        self.assertTrue(SUBSTR in s)\n-        self.assertFalse(SUBSTR * 2 in s)\n-        self.assertTrue(_('-') in s)\n-        self.assertFalse(_('a') in s)\n+        self.assertIn(SUBSTR, s)\n+        self.assertNotIn(SUBSTR * 2, s)\n+        self.assertIn(_('-'), s)\n+        self.assertNotIn(_('a'), s)\n```\n\n## Public API\n\n#### `teyit.refactor(source) -\u003e str`\n\nRun `teyit` on the given source code.\n","funding_links":[],"categories":["By Environment","Tools","UNIX-way formatters"],"sub_categories":["Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisidentical%2Fteyit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisidentical%2Fteyit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisidentical%2Fteyit/lists"}