ixc / python-edtf

MIT License
53 stars 19 forks source link

Reformat tests to use Pytest style; fix infinite comparison for OneOfASet #45

Closed ColeDCrawford closed 6 months ago

ColeDCrawford commented 6 months ago

pytest format tests have more functionality and are a bit cleaner.

The failing test was due to OneOfASet._estrict_date() potentially returning inf or -inf. This fixes the logic there to return inf or -inf if an inf or -inf are in the set with a LATEST or EARLIEST lean, respectively. It returns before making the comparison that was previously failing (TypeError: '>' not supported between instances of 'float' and 'time.struct_time').

aweakley commented 6 months ago

Wow, this makes things much clearer. Thank you.