Skip to content

meetup: test_nonexistent_fifth_monday_of_february_2015 passes when MeetupDayException doesn't exist #1344

Closed
@sep1318

Description

@sep1318

I've been running the tests trying to complete this problem, and have noticed that the test_nonexistent_fifth_monday_of_february_2015 test passes when I don't think it should. I have not yet implemented the MeetupDayException, which is what it is supposed to be testing for. But since I have not yet implemented it, the try block around its import fails, and the test is then only looking for any Exception to be thrown.

I feel like this results in false positives for this test.

$ pytest -v
============================================================================================================ test session starts ============================================================================================================
platform linux -- Python 3.6.4, pytest-3.4.0, py-1.5.2, pluggy-0.6.0 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: [...]/exercism/python/meetup, inifile:
collected 97 items
[...]
meetup_test.py::MeetupTest::test_nonexistent_fifth_monday_of_february_2015 PASSED                                                                                                                                                     [ 55%]
$ python
Python 3.6.4 (default, Jan  5 2018, 02:35:40)
[GCC 7.2.1 20171224] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import meetup
>>> meetup.meetup_day(2015, 2, "Monday", "5th")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/[...]/exercism/python/meetup/meetup.py", line 12, in meetup_day
    if calendar.weekday(year, month, candidate) == day_list.index(day_of_the_week):
  File "/usr/lib/python3.6/calendar.py", line 116, in weekday
    return datetime.date(year, month, day).weekday()
ValueError: day is out of range for month

If you need me to provide more/other information, please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions