|
1 | 1 | # pylint: disable=unused-argument,assignment-from-no-return |
2 | 2 | import os |
3 | 3 | import urllib.error # pylint: disable=unused-import |
4 | | -import pytest |
5 | 4 | from unittest.mock import MagicMock, patch |
6 | 5 |
|
| 6 | +import pytest |
| 7 | + |
7 | 8 | import matplotlib.pyplot as plt |
8 | 9 | from PIL import UnidentifiedImageError # pylint: disable=unused-import |
9 | 10 |
|
@@ -154,7 +155,7 @@ def test_ellipses_image_takes_precedence_over_background(mock_show, tmp_path): |
154 | 155 |
|
155 | 156 | # Test that when both image and background are provided, image takes precedence |
156 | 157 | # This should not attempt to download background map |
157 | | - import numpy as np |
| 158 | + import numpy as np # pylint: disable=import-outside-toplevel |
158 | 159 |
|
159 | 160 | mock_image = np.zeros((100, 100, 3), dtype=np.uint8) # RGB image |
160 | 161 |
|
@@ -217,7 +218,7 @@ def test_ellipses_background_contextily_not_installed(mock_show): |
217 | 218 | Mocks the matplotlib.pyplot.show() function to avoid showing the plots. |
218 | 219 | """ |
219 | 220 | mock_monte_carlo = MockMonteCarlo(environment=SimpleEnvironment()) |
220 | | - from rocketpy.tools import import_optional_dependency as original_import |
| 221 | + from rocketpy.tools import import_optional_dependency as original_import # pylint: disable=import-outside-toplevel |
221 | 222 |
|
222 | 223 | # Create a mock function that only raises exception when importing contextily |
223 | 224 | def mock_import_optional_dependency(name): |
@@ -391,8 +392,8 @@ def test_ellipses_background_bounds2img_failure( |
391 | 392 | List of expected message substrings in the raised exception. |
392 | 393 | """ |
393 | 394 | mock_monte_carlo = MockMonteCarlo(environment=SimpleEnvironment()) |
394 | | - from rocketpy.tools import import_optional_dependency as original_import |
395 | | - import contextily |
| 395 | + from rocketpy.tools import import_optional_dependency as original_import # pylint: disable=import-outside-toplevel |
| 396 | + import contextily # pylint: disable=import-outside-toplevel |
396 | 397 |
|
397 | 398 | mock_contextily = MagicMock() |
398 | 399 | mock_contextily.providers = contextily.providers |
|
0 commit comments