Skip to content

Commit aa61223

Browse files
authored
Refining some wording in unittest partial mock doc
Some of the descriptions were addressed in first person, but have now been changed to address the user reading the documentation instead.
1 parent 14c6222 commit aa61223

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/library/unittest.mock-examples.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,12 @@ this list of calls for us::
600600
Partial mocking
601601
~~~~~~~~~~~~~~~
602602

603-
In some tests I wanted to mock out a call to :meth:`datetime.date.today`
604-
to return a known date, but I didn't want to prevent the code under test from
603+
For some tests you may want to mock out a call to :meth:`datetime.date.today`
604+
to return a known date, but you may not want to prevent the code under test from
605605
creating new date objects. Unfortunately :class:`datetime.date` is written in C, and
606-
so I couldn't just monkey-patch out the static :meth:`datetime.date.today` method.
606+
so you cannot just monkey-patch out the static :meth:`datetime.date.today` method.
607607

608-
I found a simple way of doing this that involved effectively wrapping the date
608+
A simple way of doing this involves effectively wrapping the date
609609
class with a mock, but passing through calls to the constructor to the real
610610
class (and returning real instances).
611611

0 commit comments

Comments
 (0)