@@ -214,8 +214,6 @@ def test_lt_notimplemented(self):
214
214
(Undate (2022 , 1 , 1 ), Undate (2022 )),
215
215
(Undate (2022 , 12 , 31 ), Undate (2022 )),
216
216
(Undate (2022 , 6 , 15 ), Undate (2022 , 6 )),
217
- # TODO: support partially known dates that are unambiguously in range
218
- # (Undate("199X"), Undate("19XX")),
219
217
]
220
218
221
219
@pytest .mark .parametrize ("date1,date2" , testdata_contains )
@@ -227,26 +225,23 @@ def test_contains(self, date1, date2):
227
225
(Undate (1980 ), Undate (2020 )),
228
226
(Undate (1980 ), Undate (2020 , 6 )),
229
227
(Undate (1980 , 6 ), Undate (2020 , 6 )),
228
+ # partially known dates that are similar but same precision,
229
+ # so one does not contain the other
230
+ (Undate ("199X" ), Undate ("19XX" )),
231
+ # - specific month to unknown month
232
+ (Undate (1980 , 6 ), Undate (1980 , "XX" )),
233
+ # some of these might overlap, but we don't have enough
234
+ # information to determine
235
+ # - unknown month to unknown month
236
+ (Undate (1980 , "XX" ), Undate (1980 , "XX" )),
237
+ # - partially unknown month to unknown month
238
+ (Undate (1801 , "1X" ), Undate (1801 , "XX" )),
230
239
]
231
240
232
241
@pytest .mark .parametrize ("date1,date2" , testdata_not_contains )
233
242
def test_not_contains (self , date1 , date2 ):
234
243
assert date1 not in date2
235
244
236
- def test_contains_ambiguous (self ):
237
- # date not in range due to precision
238
- # TODO: can we return an unknown instead of false?
239
- # or should this raise a not implemented error?
240
-
241
- # these are cases where dates *might* overlap,
242
- # but we don't have enough information to determine
243
- # - specific month to unknown month
244
- assert Undate (1980 , 6 ) not in Undate (1980 , "XX" )
245
- # - unknown month to unknown month
246
- assert Undate (1980 , "XX" ) not in Undate (1980 , "XX" )
247
- assert Undate (1980 , 6 ) not in Undate (1980 , "XX" )
248
- assert Undate (1801 , "1X" ) not in Undate (1801 , "XX" )
249
-
250
245
def test_sorting (self ):
251
246
# sorting should be possible based on gt/lt
252
247
# test simple cases for sorting
0 commit comments