Skip to content

Commit

Permalink
Merge pull request #646 from niccokunzmann/is-broken
Browse files Browse the repository at this point in the history
Remove is_broken property
  • Loading branch information
niccokunzmann authored Jun 23, 2024
2 parents 3736f17 + ecd500c commit e27ee68
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ Breaking changes:
- Replaced ``pkg_resources.get_distribution`` with ``importlib.metadata`` in
``docs/conf.py`` to allow building docs on Python 3.12.

- Remove ``is_broken`` property. Use ``errors`` instead to check if a
component had suppressed parsing errors.
See `Issue 424 <https://github.com/collective/icalendar/issues/424>`_.

- Remove untested and broken ``LocalTimezone`` and ``FixedOffset`` tzinfo
sub-classes, see `Issue 67 <https://github.com/collective/icalendar/issues/67>`_

Expand Down
4 changes: 0 additions & 4 deletions src/icalendar/cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ def is_empty(self):
"""
return True if not (list(self.values()) + self.subcomponents) else False # noqa

@property
def is_broken(self):
return bool(self.errors)

#############################
# handling of property values

Expand Down
3 changes: 0 additions & 3 deletions src/icalendar/tests/test_components_break_on_bad_ics.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def test_ignore_exceptions_on_broken_events_issue_104(events):
https://github.com/collective/icalendar/issues/104
'''
assert events.issue_104_mark_events_broken.is_broken # TODO: REMOVE FOR NEXT MAJOR RELEASE
assert events.issue_104_mark_events_broken.errors == [(None, "Content line could not be parsed into parts: 'X': Invalid content line")]

def test_dont_ignore_exceptions_on_broken_calendars_issue_104(calendars):
Expand All @@ -23,7 +22,6 @@ def test_rdate_dosent_become_none_on_invalid_input_issue_464(events):
'''Issue #464 - [BUG] RDATE can become None if value is invalid
https://github.com/collective/icalendar/issues/464
'''
assert events.issue_464_invalid_rdate.is_broken
assert ('RDATE', 'Expected period format, got: 199709T180000Z/PT5H30M') in events.issue_464_invalid_rdate.errors
assert not b'RDATE:None' in events.issue_464_invalid_rdate.to_ical()

Expand All @@ -38,4 +36,3 @@ def test_error_message_doesnt_get_too_big(calendars, calendar_name):
calendars[calendar_name]
# Ignore part before first : for the test.
assert len(str(exception).split(': ', 1)[1]) <= 100

0 comments on commit e27ee68

Please sign in to comment.