mocker doesn't seem to work with utcnow

Bug #332489 reported by John O'Brien
2
Affects Status Importance Assigned to Milestone
Mocker
Won't Fix
Undecided
Gustavo Niemeyer

Bug Description

Based on the documentation, it seems that this should work. However it does not.

In [4]: obj = mymocker.replace("datetime.datetime.utcnow")
In [5]: obj()
Out[5]: <mocker.Mock object at 0x2558c90>
In [6]: mymocker.result(123)
In [7]: mymocker.replay()
In [8]: from datetime import datetime
In [9]: datetime.utcnow()
Out[9]: datetime.datetime(2009, 2, 21, 13, 23, 55, 216273)

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

datetime is implemented in C, so this won't work indeed.

Changed in mocker:
assignee: nobody → Gustavo Niemeyer (niemeyer)
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.