diff --git a/test-data/unit/cmdline.pyproject.test b/test-data/unit/cmdline.pyproject.test index 831bce2eb63d1..1be2d3e2cb2eb 100644 --- a/test-data/unit/cmdline.pyproject.test +++ b/test-data/unit/cmdline.pyproject.test @@ -133,3 +133,55 @@ Neither is this! description = "Factory ⸻ A code generator 🏭" \[tool.mypy] [file x.py] + +[case testSearchRecursively] +# cmd: mypy x.py +[file ../pyproject.toml] +\[tool.mypy] +\[tool.mypy.overrides] +module = "x" +disallow_untyped_defs = false +[file x.py] +pass +[out] +../pyproject.toml: tool.mypy.overrides sections must be an array. Please make sure you are using double brackets like so: [[tool.mypy.overrides]] +== Return code: 0 + +[case testSearchRecursivelyStopsGit] +# cmd: mypy x +[file .git/test] +[file ../pyproject.toml] +\[tool.mypy] +\[tool.mypy] +exclude = '''(?x)( + (^|/)[^/]*skipme_\.py$ + |(^|/)_skipme[^/]*\.py$ +)''' +[file x/__init__.py] +i: int = 0 +[file x/_skipme_please.py] +This isn't even syntatically valid! +[file x/please_skipme_.py] +Neither is this! +[out] +x/_skipme_please.py:1: error: unterminated string literal (detected at line 1) +== Return code: 2 + +[case testSearchRecursivelyStopsHg] +# cmd: mypy x +[file .hg/test] +[file ../pyproject.toml] +\[tool.mypy] +exclude = '''(?x)( + (^|/)[^/]*skipme_\.py$ + |(^|/)_skipme[^/]*\.py$ +)''' +[file x/__init__.py] +i: int = 0 +[file x/_skipme_please.py] +This isn't even syntatically valid! +[file x/please_skipme_.py] +Neither is this! +[out] +x/_skipme_please.py:1: error: unterminated string literal (detected at line 1) +== Return code: 2