Move requires_numpy, etc. decorators to globals
test_eigen.py and test_numpy_*.py have the same
@pytest.requires_eigen_and_numpy or @pytest.requires_numpy on every
single test; this changes them to use pytest's global `pytestmark = ...`
instead to disable the entire module when numpy and/or eigen aren't
available.
diff --git a/tests/test_numpy_vectorize.py b/tests/test_numpy_vectorize.py
index 718646e..e4cbf02 100644
--- a/tests/test_numpy_vectorize.py
+++ b/tests/test_numpy_vectorize.py
@@ -1,10 +1,11 @@
import pytest
+pytestmark = pytest.requires_numpy
+
with pytest.suppress(ImportError):
import numpy as np
-@pytest.requires_numpy
def test_vectorize(capture):
from pybind11_tests import vectorized_func, vectorized_func2, vectorized_func3
@@ -58,7 +59,6 @@
"""
-@pytest.requires_numpy
def test_type_selection():
from pybind11_tests import selective_func
@@ -67,7 +67,6 @@
assert selective_func(np.array([1.0j], dtype=np.complex64)) == "Complex float branch taken."
-@pytest.requires_numpy
def test_docs(doc):
from pybind11_tests import vectorized_func