Skip to content

Conversation

@mhered
Copy link
Contributor

@mhered mhered commented Sep 24, 2022

ATTENTION: before clicking "Create Pull Request" please submit some meta data, thanks!

Difficulty level (1-10): [2]
Estimated time spent (hours): [1]
Completed (yes/no): [Yes]
I stretched my coding skills (if yes what did you learn?): [learned some TDD]
Other feedback (what can we improve?): []


def test_fizzbuzz_returns_fizz_with_multiples_of_3(self):
samples = [3, 6, 9, 12]
for sample in samples:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

result = fizzbuzz(sample)
self.assertEqual(result, "FizzBuzz")

def test_fizzbuzz_raises_error_message_if_arg_not_int(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice descriptive name, I don't mind test function names to be longer

"""
FizzBuzz(int) plays FizzBuzz
"""
if not isinstance(num, int):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mypy would also catch this, but it does not prevent the function from being used by other types, after a raise you don't need the else so you could dedent the code below one level

@bbelderbos bbelderbos merged commit e96e1d1 into pybites:community Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants