formatargspec was removed in Python 3.11
That doesn't matter. The stdlib-provided mock is used for any python 3 or newer, and that old version is vendored for Python 2.x users. Got it, sorry for the noise.
https://github.com/coleifer/peewee/blob/5a55933ed28b261fbe100568125fffe0ba854b99/tests/libs/mock.py#L190

https://docs.python.org/3.11/whatsnew/3.11.html#removed

> the formatargspec function, deprecated since Python 3.5; use the inspect.signature() function and Signature object directly.