Skip to content

meetup: remove fail-safe for undefined MeetupDayException #1345

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

Merged
merged 6 commits into from
Apr 3, 2018
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
11 changes: 10 additions & 1 deletion exercises/meetup/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ def _choice(which):
return lambda dates: next(d for d in dates if 13 <= d.day <= 19)

ix = -1 if (which == 'last') else (int(which[0]) - 1)
return lambda dates: dates[ix]

def _func(dates):
if ix < len(dates):
return dates[ix]
raise MeetupDayException('day does not exist')
return _func


class MeetupDayException(Exception):
pass
7 changes: 1 addition & 6 deletions exercises/meetup/meetup_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import unittest
from datetime import date

from meetup import meetup_day

try:
from meetup import MeetupDayException
except ImportError:
MeetupDayException = Exception
from meetup import meetup_day, MeetupDayException


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
Expand Down