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

Negative testing #18

Open
alessandrofelder opened this issue Nov 4, 2021 · 0 comments
Open

Negative testing #18

alessandrofelder opened this issue Nov 4, 2021 · 0 comments
Labels
week5 Testing your code

Comments

@alessandrofelder
Copy link

alessandrofelder commented Nov 4, 2021

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.

What other similar tests could we add?

Sample Solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
week5 Testing your code
Projects
None yet
Development

No branches or pull requests

1 participant