每当源文件发生更改时,运行指定的命令(默认情况下是nose测试发现和执行工具)。

nos的Python项目详细描述


简介

每当源文件运行nose测试发现和执行工具时 改变了。

jeff winkler的nosy工具的详细版本,它运行nose 每当源文件更改时。此版本有一个命令行 添加了解析器,并且能够使用配置文件 控制监视哪些文件以及nose运行的方式。

概要

$ nosy -h

Usage: nosy [options]

Automatically run nose whenever source files change.

Options:
-h, --helpshow this help message and exit
-c CONFIG_FILE, --config=CONFIG_FILE
configuration file path and name; defaults to setup.cfg

配置文件

配置文件部分内容示例:

[nosy]
# Paths to check for changed files; changes cause nose to be run
base_path = ./
glob_patterns = *.py
exclude_patterns = *_flymake.*
extra_paths = sample.cfg
# Command line options to pass to nose
options = -x
# Command line arguments to pass to nose; e.g. part of test suite to run
tests = tests/unit_tests.py

配置文件由python标准库configparser读取 对象,因此:

  • Lines beginning with “#” or “;” are ignored and may be used to provide comments.
  • Entries can be in the form “name: value” or “name=value”, with continuations in the style of RFC 822.
  • Leading whitespace is removed from values.
  • Format string substitution in values is supported.

[nosy]第6节中可以指定选项:

  • base_path - The directory in which to start walking the tree to check for changed files. Defaults to ..
  • glob_patterns - A whitespace separated list of shell glob patterns to check for changes. Defaults to *.py.
  • exclude_patterns - A whitespace separated list of shell glob patterns to exclude when checking for changes. Defaults to ‘’.
  • extra_paths - A whitespace separated list of shell glob patterns to add to the paths that are checked for changes. Defaults to ‘’.
  • options - A string of options to be passed through to nose when it is executed.
  • tests - A string of command line arguments to be passed through to nose when it is executed. Useful for specifying part of the test suite to run.

在监视的路径中包含配置文件允许您 在飞行中改变鼻子的行为。

这个包的源代码和bug跟踪器可以在Bitbucket上找到。

更改日志

v1.2 2015年12月6日

  • 更改异常处理以保持与 Python2.5。
  • 添加用于自动化检测的流浪者和毒物配置 多个python版本。
  • 添加对Python3.2、3.3、3.4和3.5的支持。 感谢@ronnix@StefanWiechula的拉取请求, 以及@jacebrowning用于在用测试。
  • 修复测试套件问题:多个python版本。
  • 在配置文件中添加test_runner选项以指定测试 要使用的runner命令;默认为nosetests

v1.1.2 2011年9月15日

  • 修复打包错误。manifest.in中缺少changelog,并且 由于使用了上下文管理器,在Python2.5下setup.py失败。

v1.1.1 2011年9月13日

  • 重构校验和计算以扁平化嵌套循环并改进 可测试性。
  • 添加了测试套件。
  • 修正了导致noseexclude_patterns为空。感谢格雷格·哈斯金斯 修补程序,以及Bitbucket上的匿名问题报告程序。
  • 修正了导致base_path中的文件 监控。感谢格雷格·哈斯金斯的贴片。

v1.1 2011年3月21日

  • 配置文件现在默认为setup.cfg
  • 新的配置选项,使中的nosy更易于使用 具有深度目录结构的项目。校验和计算器现在 从base_path开始使用os.walk(),包括文件 由glob_patterns列表给出,不包括由 exclude_patterns的列表。由^{tt13}提供的文件$ 列表还可以全局处理前3个选项 别轻易抓住。感谢Jussi Rasinm_ki的建议。
  • paths配置选项保留为向后 仅兼容。
  • 包装从setuptools更改为distribute
  • bitbucket.org上的源代码和问题跟踪程序:https://bitbucket.org/douglatornell/nosy
  • 根据新的BSD许可证发布。
  • 在pypi上发布:http://pypi.python.org/pypi/nosy

v1.0 2008年6月13日

  • 原始版本。

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

推荐PyPI第三方库


热门话题
java JButton文本不在图标中,setBounds不工作   如何在Java、Spring和Apache中定义<beans>url   http如何从java中的JSON解析创建非静态列表?   java Android WebView未在Android 4.2.2上加载url   java如何按指定了最多值(非数字)的键对映射<String,List<Object>>进行排序   java Android studio appcombat操作栏设置   未使用getClass()加载java资源文件。getClassLoader()。getRresourceAsStream(“test.json”)   java翻新api调用返回旧数据。无法获取最新数据   java Android如何在gridlayout中以编程方式设置边距   java JavaFX负载密集型应用程序设计   java如何实现ApacheWicket服务器端线程   java什么是SpringBoot的会话范围?为什么这样不行?   java为什么这个gson函数会保存一个空白文件?   其中Java数组具有类似于arraylike的Javascript性质   java为什么在编辑JTable单元格时按escape键时不调用CancellEditing()?   Android Java我们不能实例化界面什么是游标   java Dowhile忽略条件   当使用GTFS数据的协议缓冲区时,java无法克服“无效导线类型”   java如何在hibernate上解密密码