Unitest2 with plugins,the succesor to nose
nose2的Python项目详细描述
…图片::https://travis-ci.org/nose-devs/nose2.svg?branch=master
:目标:https://travis ci.org/nose devs/nose2
:alt:build status
。图片::https://coveralls.io/repos/github/nose-devs/nose2/badge.svg?branch=master
:目标:https://coveralls.io/github/nose-devs/nose2?branch=master
:alt:coverage status
。图片::https://img.shields.io/pypi/v/nose2.svg
:目标:https://pypi.org/project/nose2/
:alt:最新的pypi版本
[![谷歌集团:ssfam news](https://img.shields.io/badge/google%20group ssfam%20news blue.svg)(https://groups.google.com/forum/!论坛/SSFAM新闻)
…图片::https://img.shields.io/badge/mail%20列表讨论%40nose2.io blue.svg
:目标:https://groups.google.com/a/nose2.io/forum/!论坛/讨论
:alt:join discus@nose2.io
欢迎来到nose2
nose2是"nose"的继承者。
请参阅"differences"(差异)以获得完整的概要信息。
nos2 vs pytest
----
``nos2`可能适合您的项目,也可能不适合您的项目。
我们鼓励您也考虑使用"pytest"这一流行的测试框架。
quickstart
——
因为"nos2"是基于unittest的,所以您可以从python标准库的"unittest文档"开始<;https://docs.python.org/library/unittest.html>;`
,然后使用nose2在上面添加值。
``nose2``在python文件中查找名称以``test``开头的测试,
运行它发现的每个测试函数。
代码块::python
"spam")
然后您可以像这样运行此测试:
$nose2-v
test_upper(test_simple.teststrings)…。好的,在0.000s中运行了1个测试,但是,``nose2``支持更多的测试配置,提供的工具比自己的'`unittest``更多。这个测试只练习了"nose2"的几个特性:
…代码块:python
"duck")
def test_is_knight(value):
断言value.startswith('sir')
好的,
试一下。试一下是骑士:2
"伊斯灵顿小姐"…失败的测试是骑士:3
"鸭子"…失败
===============================失败:测试花哨。测试是骑士:2
"伊斯林顿小姐"
回溯(最近一次调用):
文件"/mnt/ebs/home/sirosen/tmp/test_fancy.py",第6行,在test_中是_knight
assert value.startswith('sir')
assertonerror
>;assert value.startswith('sir')
value:
value='miss islington'
value.startswith=<;内置方法startsWith of str object at 0x7f3c3172f430>;
=====================================失败:test\u fancy.test\u is\u knight:3
"duck"
————
回溯(最近一次调用):
文件"/mnt/ebs/home/sirosen/tmp/test_fancy.py",test_中的第6行是_knight
assert value.startswith('sir')
assertionerror
>;assert value.startswith('sir')
values:
value='duck'
value.startswith=<;内置方法startswith of str object at 0x7f3c3172d490>;
——失败(失败=2)
_差异:https://nos2.readthedocs.io/en/latest/differences.html
…_ pytest:http://pytest.readthedocs.io/en/latest/
…_贡献:https://github.com/nose devs/nose2/blob/master/contribution.rst
…_ docs.nose2.io:https://docs.nose2.io/en/latest/
:目标:https://travis ci.org/nose devs/nose2
:alt:build status
。图片::https://coveralls.io/repos/github/nose-devs/nose2/badge.svg?branch=master
:目标:https://coveralls.io/github/nose-devs/nose2?branch=master
:alt:coverage status
。图片::https://img.shields.io/pypi/v/nose2.svg
:目标:https://pypi.org/project/nose2/
:alt:最新的pypi版本
[![谷歌集团:ssfam news](https://img.shields.io/badge/google%20group ssfam%20news blue.svg)(https://groups.google.com/forum/!论坛/SSFAM新闻)
…图片::https://img.shields.io/badge/mail%20列表讨论%40nose2.io blue.svg
:目标:https://groups.google.com/a/nose2.io/forum/!论坛/讨论
:alt:join discus@nose2.io
欢迎来到nose2
nose2是"nose"的继承者。
请参阅"differences"(差异)以获得完整的概要信息。
nos2 vs pytest
----
``nos2`可能适合您的项目,也可能不适合您的项目。
我们鼓励您也考虑使用"pytest"这一流行的测试框架。
quickstart
——
因为"nos2"是基于unittest的,所以您可以从python标准库的"unittest文档"开始<;https://docs.python.org/library/unittest.html>;`
,然后使用nose2在上面添加值。
``nose2``在python文件中查找名称以``test``开头的测试,
运行它发现的每个测试函数。
代码块::python
"spam")
然后您可以像这样运行此测试:
$nose2-v
test_upper(test_simple.teststrings)…。好的,在0.000s中运行了1个测试,但是,``nose2``支持更多的测试配置,提供的工具比自己的'`unittest``更多。这个测试只练习了"nose2"的几个特性:
…代码块:python
"duck")
def test_is_knight(value):
断言value.startswith('sir')
好的,
试一下。试一下是骑士:2
"伊斯灵顿小姐"…失败的测试是骑士:3
"鸭子"…失败
===============================失败:测试花哨。测试是骑士:2
"伊斯林顿小姐"
回溯(最近一次调用):
文件"/mnt/ebs/home/sirosen/tmp/test_fancy.py",第6行,在test_中是_knight
assert value.startswith('sir')
assertonerror
>;assert value.startswith('sir')
value:
value='miss islington'
value.startswith=<;内置方法startsWith of str object at 0x7f3c3172f430>;
=====================================失败:test\u fancy.test\u is\u knight:3
"duck"
————
回溯(最近一次调用):
文件"/mnt/ebs/home/sirosen/tmp/test_fancy.py",test_中的第6行是_knight
assert value.startswith('sir')
assertionerror
>;assert value.startswith('sir')
values:
value='duck'
value.startswith=<;内置方法startswith of str object at 0x7f3c3172d490>;
——失败(失败=2)
_差异:https://nos2.readthedocs.io/en/latest/differences.html
…_ pytest:http://pytest.readthedocs.io/en/latest/
…_贡献:https://github.com/nose devs/nose2/blob/master/contribution.rst
…_ docs.nose2.io:https://docs.nose2.io/en/latest/