MankiratKaur / googletransitdatafeed

Automatically exported from code.google.com/p/googletransitdatafeed
0 stars 0 forks source link

Make tests work with hash seed randomization turned on #352

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
As discussed in http://bugs.python.org/issue13703, Python will eventually start 
using a randomized hash seed, which affects the iteration order of things like 
dicts and sets.  Admittedly, this won't be enabled by default until Python 3.3, 
but the functionality can be turned on selectively all the way back to Python 
2.6.  When it IS turned on, it breaks a number of unit tests in the transitfeed 
library that make assumptions about the order of validation exceptions.  The 
order of the exceptions can be a function of underlying dictionary iteration 
order, so the test end up being non-deterministic.

I happen to run the transitfeed library in a 2.7 environment where randomized 
hash seeding has been enabled by default, so I'd like to get these tests fixed. 
 To do so, I will introduce a strict ordering of validation exceptions in unit 
tests that will be deterministic even if the original order of the exceptions 
is not.

Original issue reported on code.google.com by bdfer...@google.com on 16 Nov 2012 at 2:57

GoogleCodeExporter commented 8 years ago

Original comment by bdfer...@google.com on 16 Nov 2012 at 2:57

GoogleCodeExporter commented 8 years ago
Fixed in r1731.

Original comment by bdfer...@google.com on 16 Nov 2012 at 4:18