# nosy

Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

# Nosy

## Introduction

Run the nose test discovery and execution tool whenever a source file is changed.

An elaborated version of Jeff Winkler's nosy tool that runs nose whenever a source file is changed. This version has a command line parser added, and the capability to use a configuration file to control what files are watched, and how nose runs.

## Synopsis

\$ 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

## Configuration File

Configuration file section contents example:

[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


Configuration file is read by a Python standard library ConfigParser object, so:

• 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.

Within the [nosy] section 6 options may be specified:

• 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.

Including the configuration file in the watched paths allows you to change nose's behaviour on the fly.

The source code and bug tracker for this package is available on Bitbucket.

# Recent activity

Python 3.x compatibility fixes

Config option to clear terminal between test runs, for easier reading

A few changes (mainly the addition of commandline arguments to complement configuration file)

Commits by Doug Latornell were pushed to douglatornell/nosy

10c93f4 - Handle OSError when command to be run on file change is not found.
f7c3240 - Change command line parser to argparse.
ca9e3e5 - Not just for nose anymore.
be4ae12 - Add test_runner option to config file to specify test runner command to use.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.