Roundup Tracker - Issues

Message6483

Author rouilj
Recipients joseph_myers, rouilj
Date 2019-05-24.21:24:49
Message-id <20190524212448.386C94C02D9@itserver6.localdomain>
In-reply-to <alpine.DEB.2.21.1905242023010.371@digraph.polyomino.org.uk>
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.
History
Date User Action Args
2019-05-24 21:24:49rouiljsetrecipients: + rouilj, joseph_myers
2019-05-24 21:24:49rouiljlinkissue2551033 messages
2019-05-24 21:24:49rouiljcreate