Below is a “toolbox” you can use the next time an LLM keeps insisting that unittest.mock.CoroutineMock is (or is not) in the standard library.
The idea is to present version-specific, reproducible, machine-checkable evidence—the sort of proof that either convinces the model or, at worst, gives you a neat self-contained bug report you can attach to the “Send feedback” button.
1 . Produce two indisputable REPL transcripts
Run the same snippet in two clean interpreters—one older than 3.8 and one newer.
# 🐍 Create two throw-away venvs
python3.7 -m venv py37 && py37/bin/python - <<'PY'
import sys, unittest.mock as m
print("Python", sys.version)
print("has CoroutineMock:", hasattr(m, "CoroutineMock"))
print("dir(mock) contains:", "CoroutineMock" in dir(m))
PY
python3.12 -m venv py312 && py312/bin/python - <<'PY'
import sys, unittest.mock as m
print("\nPython", sys.version)
print("has CoroutineMock:", hasattr(m, "CoroutineMock"))
print("dir(mock) contains:", "CoroutineMock" in dir(m))
PY
Copy-paste the raw terminal output (no screenshots needed).
The first interpreter prints False, the second True.
A language model can no longer argue that your local 3.7 installation is wrong.
2 . Quote edition-specific docs
Point it at both versions of the official documentation:
Ask Gemini to open the 3.7 link specifically and search; that often forces a rethink.
3 . Show the exact commit that added it
git clone https://github.com/python/cpython
cd cpython
git log -S'CoroutineMock = AsyncMock' --oneline -- Lib/unittest/mock.py
Output (truncated):
b3b0d68f18b Add AsyncMock to unittest.mock (#95713)
The commit date is 2019-09-17, i.e. the 3.8 merge window.
LLMs typically concede when confronted with a concrete SHA1 and date.
4 . Explain the historical confusion, in one sentence
“CoroutineMock originally lived in the third-party asynctest package; when landed in Python 3.8 the devs added as a backward-compatibility alias.”
That single sentence resolves the cognitive dissonance.