単体テストを実行したいドキュメントテストを含むPythonスクリプトを含むフォルダーがあります。このような1つのファイルでテストしようとすると:
import unittest
suite = unittest.TestSuite()
suite.addTest('/homes/ndeklein/workspace/MS/PyMS/pyMS/baseFunctions.py')
unittest.TextTestRunner().run(suite)
このエラーが発生します:
TypeError: the test to add must be callable
ただし、コマンドラインから実行すると
python '/homes/ndeklein/workspace/MS/PyMS/pyMS/baseFunctions.py'
できます。
ファイルを呼び出し可能にするにはどうすればよいですか?