fizzbuzz: add initial executable
This commit is contained in:
parent
927558fd7a
commit
bbba7507c6
10
fizzbuzz/fizzbuzz.py
Executable file
10
fizzbuzz/fizzbuzz.py
Executable 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()
|
7
fizzbuzz/test_fizzbuzz.py
Normal file
7
fizzbuzz/test_fizzbuzz.py
Normal 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"
|
Loading…
Reference in a new issue