{"id":13800580,"url":"https://github.com/orsinium-labs/mypy-test","last_synced_at":"2025-04-15T21:26:05.693Z","repository":{"id":113465233,"uuid":"386228683","full_name":"orsinium-labs/mypy-test","owner":"orsinium-labs","description":"Test mypy plugins, stubs, custom types.","archived":false,"fork":false,"pushed_at":"2023-10-24T12:35:46.000Z","size":21,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-22T12:32:39.750Z","etag":null,"topics":["mypy","python","testing","typing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"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/orsinium-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2021-07-15T09:05:36.000Z","updated_at":"2023-10-24T13:26:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"73a2a713-ab33-43be-99e4-40c32005036b","html_url":"https://github.com/orsinium-labs/mypy-test","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsinium-labs%2Fmypy-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsinium-labs%2Fmypy-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsinium-labs%2Fmypy-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsinium-labs%2Fmypy-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orsinium-labs","download_url":"https://codeload.github.com/orsinium-labs/mypy-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249155888,"owners_count":21221672,"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":["mypy","python","testing","typing"],"created_at":"2024-08-04T00:01:13.942Z","updated_at":"2025-04-15T21:26:05.672Z","avatar_url":"https://github.com/orsinium-labs.png","language":"Python","funding_links":[],"categories":["Tools"],"sub_categories":["Testing"],"readme":"# mypy_test\n\nTest [mypy](https://mypy.readthedocs.io/en/stable/) plugins, stubs, custom types.\n\nCreate a Python file, add comments to lines where you expect mypy to produce an error, run `mypy_test`, and it will check if actual errors are the same as you expect.\n\nFeatures:\n\n+ **Flexible**: supports every feature supported by mypy, does not enforce a project structure.\n+ **Fast**: mypy gets run only once for all files at once. Also, no patching, no config generation.\n+ **Easy to learn**: run `mypy_test` with the same arguments as you would run mypy, and it just works.\n+ **Lightweight**: no dependencies except mypy.\n\n```bash\npython3 -m pip install mypy-test\n```\n\n## Usage\n\n1. Write a file you want to test, add comments to the lines you expect to fail:\n\n    ```python\n    a = 1\n    reveal_type(a)  # R: builtins.int\n    ```\n\n2. Run the tool:\n\n    ```bash\n    python3 -m mypy_test example.py\n    ```\n\n## Writing the comments\n\n+ The comments have the following format: `SEVERITY: MESSAGE`.\n+ Severity is a one-letter violation severity as reported by mypy.\n  + `F` for \"fatal\"\n  + `E` for \"error\"\n  + `W` for \"warning\"\n  + `N` for \"note\"\n  + `R` is a shorthand for `N: Revealed type is \"...\"`\n+ Comment can be on the same line as the violation or on the line before.\n\nExample:\n\n```python\nvar = 1.1\nreveal_type(var)  # R: builtins.float\n\n# E: Incompatible types in assignment (expression has type \"str\", variable has type \"float\")\nvar = \"\"\n```\n\nTips:\n\n+ The fastest way to know the severity and the message is to run `mypy_test` on the code and then copy-paste the resulting message.\n+ Make separate functions for every test case, so it can have a nice description and a clean namespace.\n+ Place all test files into one directory. For example, `/types/` or `/tests/types/`.\n\n## Alternatives\n\n+ [pytest-mypy-plugins](https://github.com/typeddjango/pytest-mypy-plugins) - pytest plugin, test cases described in a YAML file.\n+ [pytest-mypy-testing](https://github.com/davidfritzsche/pytest-mypy-testing) - pytest plugin, tests are described like pytest test cases (but they actually don't get run).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forsinium-labs%2Fmypy-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forsinium-labs%2Fmypy-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forsinium-labs%2Fmypy-test/lists"}