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

Writing a test for times.py #16

Open
alessandrofelder opened this issue Oct 28, 2021 · 0 comments
Open

Writing a test for times.py #16

alessandrofelder opened this issue Oct 28, 2021 · 0 comments
Labels
preparation Exercises to do before the class week5 Testing your code

Comments

@alessandrofelder
Copy link

alessandrofelder commented Oct 28, 2021

This exercise will look at understanding what a given python function (times.py) does, and writing a test to check that it works as expected.

  1. Fork the times-tests repository and clone it on your computer.
  2. Read the description of the exercise in the README file.
  3. Start by reading the code in times.py, understanding what it does, and running it (before making any modifications to it).
  4. The next step consists of converting the __main__ part of the code into a unit test.
  5. Check that your test passes by running pytest.
  6. When you are happy with your solution (or want some feedback!):
    1. Push your new code to your own fork.
    2. On GitHub, open a pull request from your fork to the original repository.
    3. In the description, include the text Answers UCL-MPHY0021-21-22/RSE-Classwork#16. This will list your PR to this issue.
    4. On the PR text, comment on what you found difficult or interesting, or something you learned.
  7. Choose one of the other pull requests listed on this issue, and leave a review. Comment on things you find interesting or don't understand, any problems you think you spot, good solutions, or potential improvements.
  8. Mark the assignment on Moodle as complete.
  9. Think about what other aspects of times.py should be tested and report them on the Moodle questionnaire.

If you have questions or get stuck, ask on Moodle or book an office hours slot!

Sample solution

@alessandrofelder alessandrofelder added preparation Exercises to do before the class week5 Testing your code labels Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preparation Exercises to do before the class week5 Testing your code
Projects
None yet
Development

No branches or pull requests

1 participant