初学python,在pycharm里试试函数调用,命名了test1(),test2()函数后报错:
Testing started at 13:29 …
Launching unittests with arguments python -m unittest discover -s E:/pythonWorks/say_hello -p 函数调用.py -t E:\pythonWorks\say_hello in E:\pythonWorks\say_hello
Ran 0 tests in 0.000s
OK
Process finished with exit code 0
Empty test suite.
原因是test为关键字,不能出现在函数名或文件名中,应避免在函数及文件命名中使用。