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