允许您根据测试的属性修改测试的docstring

nose-docstring-modifier的Python项目详细描述


该项目位于GitHub

安装

您可以使用pip安装nose docstring修饰符

$ pip install nose-docstring-modifier

使用

给定以下测试函数,它使用nose ittr插件:

@ittr(platforms=['P1','P2','P3'])@attr(section='MySection',type='functional+',module='MyModule',id=1)deftest_function(self):"""
    This is the original docstring
    """forplatforminself.platforms:ok_(True)

使用nosetest使用nose docstring修饰符运行它插件:

nosetests --with-docstring-modifier --prefix=id,section,platform --suffix=type --replace=('s','S')

将打印

(1, MySection, P1) ThiS iS the original docString (functional+) ... ok
(1, MySection, P2) ThiS iS the original docString (functional+) ... ok
(1, MySection, P3) ThiS iS the original docString (functional+) ... ok

请注意,如果在docstring上硬编码平台,则无法获得动态输出,即使测试在三个不同的平台上运行,也将获得相同的平台。

功能

  • 使用多进程插件:
nosetests --processes=10 --process-restartworker with-docstring-modifier --prefix=id

在10个进程之间展开测试运行,将id属性附加到每个测试。

历史记录

0.0.6(2014-11-25)

  • 增加了仅显示docstring第一行的功能
  • 改变了–replace调用:–replace=('s','s')

0.0.5(2014-11-24)

  • 修补程序-修复了运行插件时由于与另一个即将到来的插件的依赖关系而导致错误的错误

0.0.4(2014-11-06)

  • 代码设计更改

0.0.3(2014-11-05)

  • 多处理支持

0.0.2(2014-11-04)

  • 初始版本

作者

Authors:

Maroun Maroun

Contributors:

Tal Ben Basat

Nicole Franco

Roy Klinger

Sergey Ragatsky

Version:

0.0.6 of 26/11/2014

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
线程“main”java中的socket异常。网SocketException:在java上重置连接。木卫一。缓冲读取器。读线(未知源)   java原子参考   如何使用Java以编程方式确定两个XML文件(如XPATH)之间的差异?   java使用ApachePOI从存在于不同行中的两列中提取公共值   java在JavaFX中使用WebView会破坏Linux上的UI   Java中for循环中的If语句   Java中Hilberts空间填充曲线算法   由于出现错误,使用Reformation2下载的java文件停止工作   java是否可以通过编程方式控制setjaxbvalidationeventhandler?   没有Eclipse GUI的java Eclipse RCP应用程序   多线程在Java中使用线程安全集合时,处理并发问题的最佳方法是什么?   swing Java LWJGL和JOptionPane   java JPA:设置@JoinColumn(updateable=false)以避免OptimisticLockException   java GL VertexBuffer无效操作   java在Swing中实现后退/前进按钮   java在同一个JTable上创建两个表   类文件中的java不兼容魔术值1008813135   在Java中使用“@”的c#文字字符串?