spulec/freezegun — pull request #53 by tyewang (2014-09-13 19:39:27+00:00)
Title: Allow nested freezing

I noticed that nested freeze_times doesn't work properly. Specifically, if I `freeze_time(time_A)`, and then I `freeze_time(time_B)`, exiting `freeze_time(time_B)` does not set the time to time_A. Instead, it just resets all the time functions to their real versions.

This commit turns `time_to_freeze` into `times_to_freeze`, a stack that keeps track of all the previous frozen times. By keeping track of the times we have frozen, we can correctly exit nested freeze_times.

This PR needs to be merged after https://github.com/spulec/freezegun/pull/52 is merged.