khal: 0.10.1 tests failing: test_multi_uid_vdir, test_birthdays, test_birthdays_no_year

When attempting to build 0.10.1 for Arch Linux, I get the following test failures:

============================= test session starts ==============================
platform linux -- Python 3.7.3, pytest-4.3.1, py-1.8.0, pluggy-0.9.0
rootdir: /build/khal/src/khal-0.10.1, inifile:
collected 286 items

tests/backend_test.py ..........................                         [  9%]                                                                                                                  
tests/cal_display_test.py ......xxx                                      [ 12%]
tests/cli_test.py .............x.........................                [ 25%]
tests/configwizard_test.py .                                             [ 26%]
tests/controller_test.py ............                                    [ 30%]
tests/event_test.py ............................................         [ 45%]
tests/khalendar_test.py ....................F.....F.F                    [ 55%]
tests/khalendar_utils_test.py .......................................    [ 69%]
tests/parse_datetime_test.py ........................................... [ 84%]
....                                                                     [ 86%]
tests/settings_test.py ............                                      [ 90%]
tests/terminal_test.py ...                                               [ 91%]
tests/utils_test.py ...........                                          [ 95%]
tests/vdir_test.py x..                                                   [ 96%]
tests/vtimezone_test.py ...                                              [ 97%]
tests/ui/test_calendarwidget.py ...                                      [ 98%]
tests/ui/test_editor.py ....                                             [ 99%]
tests/ui/test_widgets.py .                                               [100%]                                                                                                                  

=================================== FAILURES ===================================
______________________ TestCollection.test_multi_uid_vdir ______________________

self = <tests.khalendar_test.TestCollection object at 0x6ea961dc7978>
coll_vdirs = (<khal.khalendar.khalendar.CalendarCollection object at 0x6ea961dc7898>, {"Dad's calendar": <khal.khalendar.vdir.Vdir ...: <khal.khalendar.vdir.Vdir object at 0x6ea961dc7f60>, 'priv
ate': <khal.khalendar.vdir.Vdir object at 0x6ea961dc77f0>})
caplog = <_pytest.logging.LogCaptureFixture object at 0x6ea96070a4a8>
fix_caplog = None
                                                                                                                                                                                                 
    def test_multi_uid_vdir(self, coll_vdirs, caplog, fix_caplog):
        coll, vdirs = coll_vdirs
        caplog.set_level(logging.WARNING)
        vdirs[cal1].upload(DumbItem(_get_text('event_dt_multi_uid'), uid='12345'))
        coll.update_db()
        assert list(coll.search('')) == []
        messages = [rec.message for rec in caplog.records]
>       assert messages[0].startswith(
            "The .ics file at foobar/12345.ics contains multiple UIDs.\n"
        )
E       IndexError: list index out of range                                                                                                                                                      
                                                                    
tests/khalendar_test.py:348: IndexError                                         
________________________________ test_birthdays ________________________________
                                                                                                                                                                                                  
coll_vdirs_birthday = (<khal.khalendar.khalendar.CalendarCollection object at 0x6ea960792588>, {"Dad's calendar": <khal.khalendar.vdir.Vdir ...: <khal.khalendar.vdir.Vdir object at 0x6ea96079232
0>, 'private': <khal.khalendar.vdir.Vdir object at 0x6ea9607925c0>})                                                                                                                              
                                                           
    def test_birthdays(coll_vdirs_birthday):                         
        coll, vdirs = coll_vdirs_birthday
        assert list(                                                                                                                                                                             
            coll.get_floating(dt.datetime(1971, 3, 11), dt.datetime(1971, 3, 11, 23, 59, 59))
        ) == list()                               
        vdirs[cal1].upload(DumbItem(card, 'unix'))
        coll.update_db()                                                          
>       assert 'Unix\'s 41st birthday' == list(                                              
            coll.get_floating(dt.datetime(2012, 3, 11), dt.datetime(2012, 3, 11)))[0].summary
E       IndexError: list index out of range               
                                       
tests/khalendar_test.py:533: IndexError                                        
____________________________ test_birthdays_no_year ____________________________
                                                                               
coll_vdirs_birthday = (<khal.khalendar.khalendar.CalendarCollection object at 0x6ea960603b00>, {"Dad's calendar": <khal.khalendar.vdir.Vdir ...: <khal.khalendar.vdir.Vdir object at 0x6ea96060320
8>, 'private': <khal.khalendar.vdir.Vdir object at 0x6ea960603710>})
                                                                                
    def test_birthdays_no_year(coll_vdirs_birthday):                            
        coll, vdirs = coll_vdirs_birthday                                                                                                                                                         
        assert list(                                                                                                                                                                              
            coll.get_floating(dt.datetime(1971, 3, 11), dt.datetime(1971, 3, 11, 23, 59, 59))                                                                                                     
        ) == list()                                        
        vdirs[cal1].upload(DumbItem(card_no_year, 'vcard.vcf'))      
        coll.update_db()                 
        events = list(coll.get_floating(dt.datetime(1971, 3, 11), dt.datetime(1971, 3, 11, 23, 59, 59)))                                                                                         
>       assert len(events) == 1                                                              
E       assert 0 == 1                             
E        +  where 0 = len([])                     
                                                                                  
tests/khalendar_test.py:581: AssertionError                                                  
=============== 3 failed, 278 passed, 5 xfailed in 4.25 seconds ================             

with:

  • atomicwrites 1.3.0
  • click 0.7
  • click-log 0.3.2
  • configobj 5.0.6
  • dateutil 2.8.0
  • icalendar 4.0.3
  • pytz 2018.9
  • setuptools 40.8.0
  • tzlocal 1.5.1
  • urwid 2.0.1
  • xdg 0.26
  • setproctitle 1.1.10
  • vdirsyncer 0.16.7
  • setuptools-scm 3.2.0
  • sphinxcontrib-newsfeed 0.1.4
  • freezegun 0.3.11
  • pytest 4.3.1

While the first test failure is related to #854, the latter two are new ones.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 26 (6 by maintainers)

Commits related to this issue

Most upvoted comments

We encountered similar issues migrating to GitHub Actions (#1075) which were caused by low clock/mtime resolution. master now has some delays, so it may be worth revisiting this in case that solves it for you too.