Oct-15-2017, 11:21 AM
I have a file called
When I try to run this file I get the following error in my interactive shell:
calc.pyand
test_calc.pyin my file called
test_calc.pyI have written:
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:
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'Why is this happening?
