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

Remove is_broken property #646

Merged
merged 2 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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