Rely on backports.entry_points_selectable for forward compatibility with importlib.metadata.

This commit is contained in:
Jason R. Coombs 2021-03-30 17:17:58 -04:00
parent 1d5dd156ab
commit 3d253e07f3
4 changed files with 23 additions and 25 deletions

View file

@ -3,7 +3,6 @@ import mock
import pytest
from flake8 import checker
from flake8._compat import importlib_metadata
from flake8.plugins import manager
from flake8.processor import FileProcessor
@ -104,9 +103,9 @@ def mock_file_checker_with_plugin(plugin_target):
# Load the checker plugins using the entry point mock
with mock.patch.object(
importlib_metadata,
manager,
'entry_points',
return_value={'flake8.extension': [entry_point]},
return_value=[entry_point],
):
checks = manager.Checkers()