Skip to content

Commit

Permalink
Simplify plugin test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Feb 26, 2025
1 parent 869e4fe commit a2f511c
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions satpy/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def fake_plugin_etc_path(
with mock.patch("satpy._config.entry_points", fake_iter_entry_points), \
mock.patch("satpy._config.impr_files", fake_importlib_files):
yield etc_path
# if this path was used to load entry points then we need to clear the cache
cached_entry_point.cache_clear()


def _get_entry_points_and_etc_paths(
Expand Down Expand Up @@ -289,19 +291,6 @@ def _create_yamlbased_plugin(
class TestPluginsConfigs:
"""Test that plugins are working."""

@classmethod
def setup_class(cls):
"""Set up the class of tests with a clean environment."""
cached_entry_point.cache_clear()

def teardown_method(self):
"""Tear down the test.
Make sure we leave every test the way we started.
"""
cached_entry_point.cache_clear()

def test_get_plugin_configs(self, fake_composite_plugin_etc_path):
"""Check that the plugin configs are looked for."""
from satpy._config import get_entry_points_config_dirs
Expand Down

0 comments on commit a2f511c

Please sign in to comment.