python - unittest 是否允许通过 "setup.py test"进行单一案例/套件测试?

标签 python unit-testing setuptools

我是 python 单元测试的新手,但我渴望学习! 我刚刚阅读了 python setup.py test 可以运行从 unittest 类派生的所有套件。我想知道我是否也可以使用 setup.py 来运行单个套件和/或单个测试用例,也许可以在前面的命令中添加一些修饰符,例如 python setup.py tests suitename。如果是这样,您能指出我的任何文档/示例吗?

最佳答案

你们都错了,setup.py test 可以和 -s 选项一起使用,就像 python -m unittest 一样:

cd root_of_your_package
python setup.py test -s tests.TestClass.test_method

关于python - unittest 是否允许通过 "setup.py test"进行单一案例/套件测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21167516/

相关文章:

python - Scrapy 正在重定向直接链接

asp.net-mvc - 如何在具有数据库调用的 ASP.net MVC 中正确测试 Controller

python - 使用 setuptools 安装的提升权限运行 python 脚本

python - setuptools build_ext 的行为与 distutils 不同吗?

python - sklearn train_test_split - ValueError : Found input variables with inconsistent numbers of samples

python - 在 python 中创建图形可视化

python - 我如何在我的 Django URL 中执行此操作? (.json, .xml)

android - 使用 Robotium 测试 PreferenceActivity

java - 如何从正在测试的方法中读取 application.properties 中的变量

python - 安装错误(--site-dirs)python 2.6 和 setuptools