0
I’m studying recursion and automated testing and decided to implement a recursive factorial:
def fatorial(n):
if n <= 1:
return 1
else:
return n*fatorial(n - 1)
import pytest
@pytest.mark.parametrize("entrada","esperado",[
(0,1),
(1,1),
(2,2),
(3,6),
(4,24),
(5,120)
])
def testa_fatorial(entrada,esperado):
assert fatorial(entrada) == esperado
I don’t know why the pytest is showing the error:
ERROR collecting Fatorial_pytest.py ____________________________________________________________________
In testa_fatorial: indirect fixture '(0, 1)' doesn't exist
Apparently, the test is correct. Any ideas? I’m using python 3.7 in windows 10 64 bits