Fixing bug in gametime module
Previously, gametime used the length of the current year and current month to calculate the future date in the real_seconds_until function. This caused a small bug when passing over a leap day from a year without a leap day. This change uses the datetime module to just increment the year or month, sidestepping the issue.
This commit is contained in:
parent
7ebd6a9f0e
commit
8fc7815189
2 changed files with 5 additions and 5 deletions
|
|
@ -78,7 +78,6 @@ class TestGametime(TestCase):
|
|||
self.assertAlmostEqual(gametime.real_seconds_until(day=17), 501120)
|
||||
self.assertAlmostEqual(gametime.real_seconds_until(month=1), 4752000)
|
||||
|
||||
@unittest.expectedFailure
|
||||
def test_real_seconds_until_leap_year(self):
|
||||
self.assertAlmostEqual(gametime.real_seconds_until(month=3), 5788800)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue