如何让python setup.py test
工作? - 当前输出:
$ python setup.py test # also tried: `python setup.py tests`
/usr/lib/python2.7/distutils/dist.py:267: \
UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'test'
from distutils.core import setup
if __name__ == '__main__':
setup(name='foo', version='0.1', package_dir={'foo': 'utils'},
test_suite='tests')
from unittest import TestCase, main as unittest_main
class TestTests(TestCase):
def setUp(self):
pass
def test_foo(self):
self.assertTrue(True)
self.assertFalse(False)
if __name__ == '__main__':
unittest_main()