File tree 1 file changed +23
-0
lines changed 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -586,6 +586,29 @@ def distributions():
586
586
testdir .parseconfig ()
587
587
588
588
589
+ def test_importlib_metadata_broken_distribution (testdir , monkeypatch ):
590
+ """Integration test for broken distributions with 'files' metadata being None (#5389)"""
591
+ monkeypatch .delenv ("PYTEST_DISABLE_PLUGIN_AUTOLOAD" , raising = False )
592
+
593
+ class DummyEntryPoint :
594
+ name = "mytestplugin"
595
+ group = "pytest11"
596
+
597
+ def load (self ):
598
+ return object ()
599
+
600
+ class Distribution :
601
+ version = "1.0"
602
+ files = None
603
+ entry_points = (DummyEntryPoint (),)
604
+
605
+ def distributions ():
606
+ return (Distribution (),)
607
+
608
+ monkeypatch .setattr (importlib_metadata , "distributions" , distributions )
609
+ testdir .parseconfig ()
610
+
611
+
589
612
@pytest .mark .parametrize ("block_it" , [True , False ])
590
613
def test_plugin_preparse_prevents_setuptools_loading (testdir , monkeypatch , block_it ):
591
614
monkeypatch .delenv ("PYTEST_DISABLE_PLUGIN_AUTOLOAD" , raising = False )
You can’t perform that action at this time.
0 commit comments