Integration test for broken distributions with 'files' metadata being None (#5389)
(
pytester: Pytester, monkeypatch: MonkeyPatch
)
| 992 | |
| 993 | |
| 994 | def test_importlib_metadata_broken_distribution( |
| 995 | pytester: Pytester, monkeypatch: MonkeyPatch |
| 996 | ) -> None: |
| 997 | """Integration test for broken distributions with 'files' metadata being None (#5389)""" |
| 998 | monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False) |
| 999 | |
| 1000 | class DummyEntryPoint: |
| 1001 | name = "mytestplugin" |
| 1002 | group = "pytest11" |
| 1003 | |
| 1004 | def load(self): |
| 1005 | return object() |
| 1006 | |
| 1007 | class Distribution: |
| 1008 | version = "1.0" |
| 1009 | files = None |
| 1010 | metadata = {"name": "foo"} |
| 1011 | entry_points = (DummyEntryPoint(),) |
| 1012 | |
| 1013 | def distributions(): |
| 1014 | return (Distribution(),) |
| 1015 | |
| 1016 | monkeypatch.setattr(importlib_metadata, "distributions", distributions) |
| 1017 | pytester.parseconfig() |
| 1018 | |
| 1019 | |
| 1020 | @pytest.mark.parametrize("block_it", [True, False]) |
nothing calls this directly
no test coverage detected