Message6483
Hi Joseph:
In message <alpine.DEB.2.21.1905242023010.371@digraph.polyomino.org.uk>,
Joseph Myers writes:
>I think that looks OK, but the test should have everything that uses the
>patched date.Date inside a
>
>date.Date = dummyDate()
>try:
> ... rest of test contents ...
>finally:
> date.Date = originalDate
>
>to ensure that the patching is undone if an exception occurs during the
>test code. (Once we can assume Python 3, unittest.mock.patch can be used
>for this.)
Just made the change. That was a try:/finally: with no except right? I
assume any exception that is raised will trigger the finally code and
then be bubbled up the stack to be handled by an except handler at a
higher level.
Just ran that specific test under py2/py3 to make sure
I got the syntax right. See checkin: 5728:bfd28644fe43
If that change works for you, feel free to just close the ticket. |
|
Date |
User |
Action |
Args |
2019-05-24 21:24:49 | rouilj | set | recipients:
+ rouilj, joseph_myers |
2019-05-24 21:24:49 | rouilj | link | issue2551033 messages |
2019-05-24 21:24:49 | rouilj | create | |
|