zopefoundation / DateTime

This package provides a DateTime data type, as known from Zope. Unless you need to communicate with Zope APIs, you're probably better off using Python's built-in datetime module.
Other
19 stars 25 forks source link

Update to latest meta/config templates #66

Closed dataflake closed 2 weeks ago

dataflake commented 2 weeks ago

There's an exclude for teyit because some tests want to specifically test something teyit would change, like the following test code: FIXED

        dt = DateTime(1)
        <...>
        self.assertTrue(dt == DateTime(1))  # testing __eq__
        self.assertFalse(dt != DateTime(1))  # testing __ne__
perrinjerome commented 2 weeks ago

Ah I was worried that something like what you describe with teyit https://github.com/zopefoundation/DateTime/pull/61#discussion_r1413129912 would happen.

How about writing it like this instead, separating the == and != to another line ?

        is_eq = dt == DateTime(1.0)  # testing __eq__
        self.assertTrue(is_eq)

in other places, something like this is checked:

self.assertTrue(str(dt).find('60') < 0)

this seems better:

self.assertNotIn('60', str(dt))

please include the changes from https://github.com/zopefoundation/DateTime/commit/70d34a4b5eb1279bb3c5f6e01ff8daf67a1f6759 if you like this.