quaint-telephone-89068
06/14/2026, 6:29 PM_pytest.config._console_main attribute, renaming it to the public _pytest.config.console_main. The Pants PEX-based pytest runner invokes pytest via its console_scripts entry point, which references _pytest.config:_console_main. This causes an AttributeError at test-run time with pytest ≥ 9.1.
Error
AttributeError: module '_pytest.config' has no attribute '_console_main'. Did you mean: 'console_main'?
Steps to reproduce
1. Use Pants 2.32.0 with a Python project that depends on pytest>=9.1.
2. Run pants test ::.
Root cause
pytest changed its console script entry point from _pytest.config:_console_main to _pytest.config:console_main in 9.1.0. The Pants PEX runner builds a PEX that hard-codes the old entry point name.
Relevant pytest change: https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst
Workaround
Pin pytest<9.1 in all project pyproject.toml files until Pants is updated to use the new entry point.
Expected behavior
Pants should invoke pytest via the public console_main entry point (or via pytest.main()) so that it works with pytest ≥ 9.1.
Environment
• Pants version: 2.32.0
• pytest version: 9.1.0
• Python: 3.13
pantsbuild/pantsquaint-telephone-89068
06/15/2026, 11:50 PM