0
Where am I going wrong?
Bhaskara.py
import math
class Bhaskara:
def delta(self, a, b, c):
return b**2 -4*a*c
def main(self):
a_digitado =float(input())
b_digitado =float(input())
c_digitado =float(input())
print(self.calcula_raizes(a_digitado, b_digitado, c_digitado))
def calcula_raizes(self, a, b, c):
d = self.delta(a, b, c)
if d==0:
raiz1=(-b + math.sqrt(d))/(2*a)
return 1, raiz1
else:
if d<0:
return 0
else:
raiz1=(-b + math.sqrt(d))/(2*a)
raiz2=(-b - math.sqrt(d))/(2*a)
return 2, raiz1, raiz2
test_Bhaskara.py file
import Bhaskara
import pytest
class Testbaskara:
@pytest.mark.parametrize('entrada, esperado', [
[(1, 0, 0,), (1, 0,)],
])
def test_Bhaskara(entrada, esperado):
b = Bhaskara.Bhaskara()
assert b.calcula_raizes(entrada) == (esperado)
Exit:
============================= test session starts ==============================
platform linux2 -- Python 2.7.15rc1, pytest-3.3.2, py-1.5.2, pluggy-0.6.0 rootdir: /home/danlawand/Python, inifile: collected 0 items / 1 errors
==================================ERRORS================================
[appears other several comments]
And
Valueerror: uses in argument 'input'