Jonardan Cena
Jonardan Cena

Reputation: 383

Getting AssertionError in Nose Testing Framework Python Qualis

        for exp in expected:

>           assert bool(re.search(exp, code))

E           AssertionError

.test/test_nose.py:64: AssertionError

this is the error i am getting and this is where i have defined the assert:

def test_circlearea_with_random_numeric_radius(self):
    # Define a circle 'c1' with radius 2.5, and check if 
    # its area is 19.63.
    c1 = Circle(2.5)
assert c1.area() == 19.63

Is anyone having any idea why is this happening ?

Upvotes: 0

Views: 445

Answers (1)

Pradzzz
Pradzzz

Reputation: 21

Just came across this post now ..

Pls Use as below and also use 'from nose.tools import assert_raises, eq_'

def test_circlearea_with_random_numeric_radius(self):
    # Define a circle 'c1' with radius 2.5, and check if 
    # its area is 19.63.
    c1 = Circle(2.5)
    eq_(c1.area(),19.63) #<--as the test_nose.py program is looking for eq_() 

Upvotes: 2

Related Questions