| 62 | |
| 63 | @pytest.mark.slow |
| 64 | def test_warning_calls(): |
| 65 | # combined "ignore" and stacklevel error |
| 66 | base = Path(numpy.__file__).parent |
| 67 | |
| 68 | for path in base.rglob("*.py"): |
| 69 | if base / "testing" in path.parents: |
| 70 | continue |
| 71 | if path == base / "__init__.py": |
| 72 | continue |
| 73 | if path == base / "random" / "__init__.py": |
| 74 | continue |
| 75 | if path == base / "conftest.py": |
| 76 | continue |
| 77 | # use tokenize to auto-detect encoding on systems where no |
| 78 | # default encoding is defined (e.g. LANG='C') |
| 79 | with tokenize.open(str(path)) as file: |
| 80 | tree = ast.parse(file.read()) |
| 81 | FindFuncs(path).visit(tree) |