Skip to content

Commit 0879591

Browse files
Reword the NEWS entry and versionchanged
A tuple *spec* worked before, except in dir(), so this is a fix, not a new feature. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent 5513129 commit 0879591

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Doc/library/unittest.mock.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ the *new_callable* argument to :func:`patch`.
243243
allows mocks to pass :func:`isinstance` tests.
244244

245245
.. versionchanged:: next
246-
*spec* can now be a tuple of strings.
246+
:func:`dir` now works for a mock created with a tuple *spec*.
247247

248248
* *spec_set*: A stricter variant of *spec*. If used, attempting to *set*
249249
or get an attribute on the mock that isn't on the object passed as
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
:class:`unittest.mock.Mock` now supports a tuple of strings as *spec*,
2-
in addition to a list.
3-
Previously :func:`dir` on such a mock raised :exc:`TypeError`.
1+
Fix :func:`dir` on :class:`unittest.mock.Mock` objects
2+
created with a tuple *spec*: it raised :exc:`TypeError`.
3+
Such *spec* is now also documented.

0 commit comments

Comments
 (0)