@@ -189,11 +189,12 @@ def test_year_property(self):
189189 # unset year
190190 assert Undate (month = 12 , day = 31 ).year == "XXXX"
191191
192- # NOTE: no longer supported to inistalize undate with no date information
192+ # NOTE: no longer supported to initialize undate with no date information
193193 # force method to hit conditional for date precision
194- # some_century = Undate()
195- # some_century.precision = DatePrecision.CENTURY
196- # assert some_century.year is None
194+ some_century = Undate (year = "X" )
195+ some_century .initial_values ["year" ] = None
196+ some_century .precision = DatePrecision .CENTURY
197+ assert some_century .year is None
197198
198199 def test_month_property (self ):
199200 # one, two digit month
@@ -324,6 +325,9 @@ def test_gt_lt_unknown_years(self):
324325 assert not some_january >= year100
325326
326327 def test_lt_notimplemented (self ):
328+ # unsupported type should bail out and return NotImplemented
329+ assert Undate (2022 ).__lt__ ("foo" ) == NotImplemented
330+
327331 # how to compare mixed precision where dates overlap?
328332 # if the second date falls *within* earliest/latest,
329333 # then it is not clearly less; not implemented?
@@ -356,6 +360,9 @@ def test_lt_notimplemented(self):
356360 def test_contains (self , date1 , date2 ):
357361 assert date1 in date2
358362
363+ # unsupported type should bail out and return NotImplemented
364+ assert Undate (2022 ).__contains__ ("foo" ) == NotImplemented
365+
359366 testdata_not_contains = [
360367 # dates not in range
361368 (Undate (1980 ), Undate (2020 )),
0 commit comments