Oct-15-2017, 11:21 AM
I have a file called
and
in my file called
I have written:
When I try to run this file I get the following error in my interactive shell:
Why is this happening?
1 |
calc.py |
1 |
test_calc.py |
1 |
test_calc.py |
1 2 3 4 5 6 7 8 |
import unittest import calc class TestCalc(unittest.TestCase): def test_add( self ): result = calc.add( 10 , 5 ) self .assertEqual(result, 15 ) |
When I try to run this file I get the following error in my interactive shell:
1 2 3 4 5 6 7 8 9 10 11 |
RESTART: C: / Users / sushi / AppData / Local / Programs / Python / Python36 - 32 / test_calc.py Traceback (most recent call last): File "C:/Users/sushi/AppData/Local/Programs/Python/Python36-32/test_calc.py" , line 1 , in <module> import unittest File "C:\Users\sushi\AppData\Local\Programs\Python\Python36-32\lib\unittest\__init__.py" , line 59 , in <module> from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf, File "C:\Users\sushi\AppData\Local\Programs\Python\Python36-32\lib\unittest\case.py" , line 7 , in <module> import pprint File "C:/Users/sushi/AppData/Local/Programs/Python/Python36-32\pprint.py" , line 7 , in <module> print (pprint.pformat(count)) AttributeError: module 'pprint' has no attribute 'pformat' |