Commit b672f68
committed
Fix running test_internal_cpp_api directly.
The `matplotlib._tri` module is lazily loaded, so using it directly (as
done in this test) may fail if something else doesn't load it. This test
would fail if it was the first tri-related test run in a process (if
testing in parallel), or if just called as the only test, i.e., this
commit fixes:
```
$ pytest -k test_internal_cpp_api lib/matplotlib/tests/test_triangulation.py
__________ test_internal_cpp_api __________
def test_internal_cpp_api():
# Following github issue 8197.
# C++ Triangulation.
with pytest.raises(
TypeError,
match=r'function takes exactly 7 arguments \(0 given\)'):
> mpl._tri.Triangulation()
E AttributeError: module 'matplotlib' has no attribute '_tri'
lib/matplotlib/tests/test_triangulation.py:1039: AttributeError
```1 parent 9c89f7a commit b672f68
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1031 | 1031 | | |
1032 | 1032 | | |
1033 | 1033 | | |
| 1034 | + | |
1034 | 1035 | | |
1035 | 1036 | | |
1036 | 1037 | | |
| |||
0 commit comments