File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -238,7 +238,15 @@ def pytest_runtestloop(self, session: pytest.Session):
238238
239239 return True
240240
241- @pytest .hookimpl (trylast = True )
241+ # This is tryfirst=True because we need our plugin's pytest_collection_finish
242+ # to be called before the terminal plugin's pytest_collection_finish:
243+ #
244+ # - pytest's terminal plugin hooks pytest_collection_finish, which calls
245+ # pytest_report_collectionfinish
246+ # - we hook pytest_report_collectionfinish, assuming _handle_collected_item
247+ # has already been called for all items when pytest_report_collectionfinish
248+ # is called
249+ @pytest .hookimpl (tryfirst = True )
242250 def pytest_collection_finish (self , session ):
243251 for item in session .items :
244252 self ._handle_collected_item (item )
You can’t perform that action at this time.
0 commit comments