From 43a2a5a8e68bba89a2f3f3b0f7a2c4984353e42f Mon Sep 17 00:00:00 2001 From: "Scott C. Livingston" Date: Wed, 2 Oct 2024 11:18:37 -0700 Subject: [PATCH] TEST: `skipif` in pytest gives more informative warning --- tests/plot_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/plot_test.py b/tests/plot_test.py index 2077015..a0bc47a 100644 --- a/tests/plot_test.py +++ b/tests/plot_test.py @@ -1,6 +1,6 @@ #!/usr/bin/env python """Tests for plotting.""" -import unittest +import pytest try: import matplotlib as mpl @@ -19,9 +19,9 @@ def add_patch(self, x): pass -@unittest.skipIf( +@pytest.mark.skipif( mpl is None, - '`matplotlib` is not installed') + reason='`matplotlib` is not installed') def test_plot_transition_arrow(): p0 = pc.box2poly([[0.0, 1.0], [0.0, 2.0]]) p1 = pc.box2poly([[0.1, 2.0], [0.0, 2.0]])