每当源文件发生更改时,运行指定的命令(默认情况下是nose测试发现和执行工具)。
nos的Python项目详细描述
简介
每当源文件运行nose测试发现和执行工具时 改变了。
jeff winkler的nosy工具的详细版本,它运行nose 每当源文件更改时。此版本有一个命令行 添加了解析器,并且能够使用配置文件 控制监视哪些文件以及nose运行的方式。
概要
$ nosy -h
Usage: nosy [options]
Automatically run nose whenever source files change.
- Options:
-h, --help show 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日
- 重构校验和计算以扁平化嵌套循环并改进 可测试性。
- 添加了测试套件。
- 修正了导致nose在 exclude_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日
- 原始版本。