fizzbuzz: add initial executable

This commit is contained in:
Bruno BELANYI 2019-11-30 11:36:58 +01:00
parent 927558fd7a
commit bbba7507c6
2 changed files with 17 additions and 0 deletions

10
fizzbuzz/fizzbuzz.py Executable file
View file

@ -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()

View file

@ -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"