Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using fake date/time types with @pytest.mark.parametrize fails component init #182

Open
allenporter opened this issue Apr 6, 2023 · 0 comments

Comments

@allenporter
Copy link
Owner

allenporter commented Apr 6, 2023

Describe the bug
A clear and concise description of what the bug is, and the version of the ics library used.

Traceback (most recent call last):
  File "/home/runner/work/core/core/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/home/runner/work/core/core/homeassistant/components/calendar/__init__.py", line 593, in handle_calendar_event_create
    await entity.async_create_event(**msg[CONF_EVENT])
  File "/home/runner/work/core/core/homeassistant/components/local_calendar/calendar.py", line 112, in async_create_event
    await self._async_store()
  File "/home/runner/work/core/core/homeassistant/components/local_calendar/calendar.py", line 105, in _async_store
    content = IcsCalendarStream.calendar_to_ics(self._calendar)
  File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/ical/calendar_stream.py", line 85, in calendar_to_ics
    return stream.ics()
  File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/ical/calendar_stream.py", line 65, in ics
    return encode_content(self.__encode_component_root__().components)
  File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/ical/component.py", line 212, in __encode_component_root__
    return self.__encode_component__(self.__class__.__name__, model_data)
  File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/ical/component.py", line 236, in __encode_component__
    parent.components.append(component_encoder(key, value))
  File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/ical/component.py", line 236, in __encode_component__
    parent.components.append(component_encoder(key, value))
  File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/ical/component.py", line 238, in __encode_component__
    if prop := cls._encode_property(key, field.type_, value):
  File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/ical/component.py", line 248, in _encode_property
    for sub_type in cls._get_field_types(field_type):
  File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/ical/component.py", line [198](https://github.com/home-assistant/core/actions/runs/4625525139/jobs/8181397369#step:10:199), in _get_field_types
    sortable_args.sort(reverse=True)
TypeError: '<' not supported between instances of 'FakeDatetimeMeta' and 'FakeDateMeta'

To Reproduce
Fails on CI for home-assistant

Expected behavior
Not deterministic

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant