import unittest
from name_function import get_formatted_name
class NamesTestCase(unittest.TestCase):
def test_first_last_name(self):
formatted_name=get_formatted_name('z','yt')
self.assertEqual(formatted_name,'z yt')
?
unittest.main()
E
======================================================================
ERROR: /home/jovyan/ (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: module '__main__' has no attribute '/home/jovyan/'
----------------------------------------------------------------------
Ran 1 test in 0.001s
FAILED (errors=1)
An exception has occurred, use %tb to see the full traceback.
SystemExit: True
/home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages/IPython/core/interactiveshell.py:3334: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/177173.html
下一篇:python中for回圈問題代碼
