Index: ngsPETSc/tests/test_env.py
===================================================================
--- ngsPETSc.orig/tests/test_env.py	2024-02-06 18:56:27.181914683 +0100
+++ ngsPETSc/tests/test_env.py	2024-02-06 23:33:53.846586796 +0100
@@ -3,6 +3,9 @@
 In particular it will test for: petsc4py, PETSc, NGSolve, Netgen and ngsPETSc
 '''
 
+import pytest
+pytest.importorskip("ngsolve")
+
 import petsc4py
 from petsc4py import PETSc
 
Index: ngsPETSc/tests/test_eps.py
===================================================================
--- ngsPETSc.orig/tests/test_eps.py	2024-02-06 18:56:27.181914683 +0100
+++ ngsPETSc/tests/test_eps.py	2024-02-06 23:34:06.110639065 +0100
@@ -4,6 +4,8 @@
 from math import sqrt, pi
 import pytest
 
+pytest.importorskip("ngsolve")
+
 from ngsolve import Mesh, H1, BilinearForm, grad, Integrate
 from ngsolve import x, y, dx, sin
 from netgen.geom2d import SplineGeometry
Index: ngsPETSc/tests/test_ksp.py
===================================================================
--- ngsPETSc.orig/tests/test_ksp.py	2024-02-06 18:56:27.181914683 +0100
+++ ngsPETSc/tests/test_ksp.py	2024-02-06 23:34:36.278766928 +0100
@@ -1,6 +1,9 @@
 '''
 This module test the ksp class
 '''
+import pytest
+pytest.importorskip("ngsolve")
+
 from math import sqrt
 
 from ngsolve import Mesh, H1, BilinearForm, LinearForm, grad, Integrate
Index: ngsPETSc/tests/test_mat.py
===================================================================
--- ngsPETSc.orig/tests/test_mat.py	2024-02-06 18:56:27.181914683 +0100
+++ ngsPETSc/tests/test_mat.py	2024-02-06 23:34:44.886803229 +0100
@@ -1,6 +1,9 @@
 '''
 This module test the matrix class
 '''
+import pytest
+pytest.importorskip("ngsolve")
+
 from ngsolve import Mesh, H1, VectorH1, BilinearForm, grad, div, dx
 from netgen.geom2d import unit_square
 import netgen.meshing as ngm
Index: ngsPETSc/tests/test_pc.py
===================================================================
--- ngsPETSc.orig/tests/test_pc.py	2024-02-06 18:56:27.181914683 +0100
+++ ngsPETSc/tests/test_pc.py	2024-02-06 23:34:53.138837964 +0100
@@ -1,6 +1,9 @@
 '''
 This module test the pc class
 '''
+import pytest
+pytest.importorskip("ngsolve")
+
 from math import sqrt
 
 from ngsolve import VectorH1, H1, HDiv, HCurlDiv, TangentialFacetFESpace, L2
Index: ngsPETSc/tests/test_plex.py
===================================================================
--- ngsPETSc.orig/tests/test_plex.py	2024-02-06 18:56:27.181914683 +0100
+++ ngsPETSc/tests/test_plex.py	2024-02-06 23:35:01.186871772 +0100
@@ -2,6 +2,7 @@
 This module test that plex class
 '''
 import pytest
+pytest.importorskip("ngsolve")
 
 from ngsolve import Mesh, VOL
 from netgen.geom2d import unit_square
Index: ngsPETSc/tests/test_snes.py
===================================================================
--- ngsPETSc.orig/tests/test_snes.py	2024-02-06 18:56:27.181914683 +0100
+++ ngsPETSc/tests/test_snes.py	2024-02-06 23:35:23.270964239 +0100
@@ -1,6 +1,9 @@
 '''
 This module test the snes class
 '''
+import pytest
+pytest.importorskip("ngsolve")
+
 from ngsolve import Mesh, VectorH1, BilinearForm, Variation, H1
 from ngsolve import GridFunction, CoefficientFunction, Parameter
 from ngsolve import InnerProduct, Grad, grad, dx, x,y, Id, Trace, Det, exp, log
@@ -9,8 +12,6 @@
 
 from mpi4py.MPI import COMM_WORLD
 
-import pytest
-
 from ngsPETSc import NonLinearSolver
 
 def test_snes_toy_newtonls():
Index: ngsPETSc/tests/test_vec.py
===================================================================
--- ngsPETSc.orig/tests/test_vec.py	2024-02-06 18:56:27.181914683 +0100
+++ ngsPETSc/tests/test_vec.py	2024-02-06 23:35:31.843000021 +0100
@@ -1,6 +1,9 @@
 '''
 This module test the vec class
 '''
+import pytest
+pytest.importorskip("ngsolve")
+
 from ngsolve import Mesh, H1, BilinearForm, LinearForm, dx
 from netgen.geom2d import unit_square
 import netgen.meshing as ngm
