You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Negative tests - Test that something that is expected to fail actually does fail
time_range may still work when end_time is before start_time, but that may make overlap_time not working as expected.
Work collaboratively!
Write a test that tries to generate a time range for a date going backward.
Modify time_range to produce an error (ValueError) with a meaningful message.
Use pytest.raises to check for that error (including the error message!) in the test.
Commit, push and link to this issue by including Answers https://github.com/UCL-MPHY0021-21-22/RSE-Classwork/issues/18 in the commit message.
Negative tests - Test that something that is expected to fail actually does fail
time_range
may still work whenend_time
is beforestart_time
, but that may makeoverlap_time
not working as expected.time_range
to produce an error (ValueError
) with a meaningful message.pytest.raises
to check for that error (including the error message!) in the test.Answers https://github.com/UCL-MPHY0021-21-22/RSE-Classwork/issues/18
in the commit message.What other similar tests could we add?
Sample Solution
The text was updated successfully, but these errors were encountered: