diff --git a/fizzbuzz/fizzbuzz.py b/fizzbuzz/fizzbuzz.py new file mode 100755 index 0000000..9452166 --- /dev/null +++ b/fizzbuzz/fizzbuzz.py @@ -0,0 +1,10 @@ +#! /usr/bin/env python + + +def fizzbuzz(max: int = 100) -> None: + for i in range(1, max + 1): + print(i) + + +if __name__ == "__main__": + fizzbuzz() diff --git a/fizzbuzz/test_fizzbuzz.py b/fizzbuzz/test_fizzbuzz.py new file mode 100644 index 0000000..30b304d --- /dev/null +++ b/fizzbuzz/test_fizzbuzz.py @@ -0,0 +1,7 @@ +from fizzbuzz import fizzbuzz + + +def test_fizzbuzz_counts_to_two(capsys): + fizzbuzz(2) + out, __ = capsys.readouterr() + assert out == "1\n2\n"