Copy modules before filtering `addon_modules` to avoid change of dictionnary size during iterations. Otherwise errors can be triggerd when running `python -m pytest test.py` since it may modify the module dict. Co-authored-by: Alexis-19 <alexis-19@noreply.localhost> Pull Request: https://projects.blender.org/blender/blender/pulls/121100