On 1/30/20 3:52 PM, Markus Wageringel wrote: > > While the order of dictionaries is insertion order now, functions in > Sage or in libraries that return dictionaries usually do not make any > promise about the order in which elements are inserted into the > dictionary. Thus, when doctesting such a function, the order of the > result is not specified and might easily change by a seemingly unrelated > change in our code base. This is not a huge problem, as we can update > any failing doctests, but we could also make the doctests more robust in > the first place, by sorting the output.
This is a good point, but it's a problem we already have. We don't make any promises about the precise message contained in e.g. a ValueError, but we still frequently test the contents. You just update it when you change the message. The doctest is more of a sanity check here, telling you that you've got two different answers and to go figure out which one is right. If the code is right, you update the doctest. The downside to sorting everything in the tests it that running the tests already takes several hours (8+ here). How many CPU hours do we collectively burn by sorting something 1293752893 times instead of updating the test once? -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/093109f2-575e-fd71-616d-0d82e7aa1949%40orlitzky.com.