Now we'll create a fixture that wraps around all the test modules in an entire package.
testsdirectory that we created in the last Time for action section. (That's two underbars, the word 'init, and two more underbars). The presence of this file tells Python that the directory is a package. Place the following code inside of
from mocker import Mocker from datetime import datetime mocker = Mocker() def setup(): fake_datetime = mocker.replace(datetime) fake_datetime.now() mocker.result(datetime(year = 2009, month = 6, day = 12, hour = 10, minute = 15, second = 5)) mocker.count(1, None) mocker.replay() def teardown(): mocker.restore() ...