1

Is it possible disable mypy checking for functions which for a testing? Such as starts from test_?

For me is redundant adding typing for tests

def test_dummy():  # <- mypy is raising "error: Function is missing a return type annotation"
    # Empty test
ray_otto
  • 33
  • 8
  • I think this is a duplicate of https://stackoverflow.com/questions/66222471/is-there-a-way-to-ignore-mypy-checks-on-a-single-function – Jake Jan 20 '23 at 08:36
  • If you have your tests located in specific files/folders, you can set [`ignore_errors = true`](https://mypy.readthedocs.io/en/stable/config_file.html#confval-ignore_errors) for that files. – STerliakov Jan 20 '23 at 16:58
  • @Jake I don't want use decorator because it will be need every time. I want disable mypy for test functions through one line in the settings – ray_otto Jan 21 '23 at 10:28
  • @SUTerliakov I don't want ignore whole file because inside test file can be fixtures or other helpful functions which should be checking by mypy – ray_otto Jan 21 '23 at 10:31

0 Answers0