Skip to content

Commit 4b65f03

Browse files
committed
TST: Skip tests requiring contextily in Monte Carlo plot tests
- Added pytest.importorskip for contextily in both integration and unit test files to ensure tests are only run if the required library is installed.
1 parent c9748c6 commit 4b65f03

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

tests/integration/simulation/test_monte_carlo_plots_background.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
plt.rcParams.update({"figure.max_open_warning": 0})
1717

18+
pytest.importorskip(
19+
"contextily", reason="This test requires contextily to be installed"
20+
)
21+
1822

1923
class MockMonteCarlo(MonteCarlo):
2024
"""Create a mock class to test the method without running a real simulation.

tests/unit/simulation/test_monte_carlo_plots_background.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
plt.rcParams.update({"figure.max_open_warning": 0})
1515

16+
pytest.importorskip(
17+
"contextily", reason="This test requires contextily to be installed"
18+
)
19+
1620

1721
class MockMonteCarlo(MonteCarlo):
1822
"""Create a mock class to test the method without running a real simulation.

0 commit comments

Comments
 (0)