Skip to main content

Add additional directories to sys.path for nose.

Project description

About

Written by Jesse Noller

Licensed under the Apache Software License, 2.0

You can install it with easy_install nose-pathmunge

What It Does

nose-pathmunge is a plugin to the nose test framework which provides a method to add directories to the sys.path of nose, which is inherited by the tests running within nose.

This itch stems from in many of my own cases, the need to add modules to a given run (dependencies) that I don’t want to install because they’re synced from a source control system, and change frequently.

This plugin is extremely simple. It’s meant to be.

Usage

Usage is simple - install the package, and then execute nosetests like this:

nosetests --with-path=/home/jesse/src --with-path=/other/dir

Remember the rules when appending directories to your path - you should add the directory above a module - not the module directory itself, and there needs to be a valid __init__.py file. For example, the following project layout in subversion:

myproj/
    src/
        mymodule/
            __init__.py
            foobar.py

You would add this like this:

nosetests --with-path=/home/jesse/src/myproj/src

This would add mymodule/... to the sys.path for the tests to be able to import.

Command line options

After it is installed, the plugin adds the following command line flags to nosetests:

--with-path=TESTCONFIG  Additional directories to add to the nose sys.path
                        [NOSE_ADDITIONAL_PATHS]

You can pass in as many paths as you like. I suggest 3, as that’s a pleasant number.

TODO

  • Verify works/doesn’t work with multiprocess plugin

  • Add tests

Changes & News

0.1.2:

Fix PyPI issues; fix easy_install(ability)

0.1:

Initial release. May contain bits of glass.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nose-pathmunge-0.1.2.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file nose-pathmunge-0.1.2.tar.gz.

File metadata

File hashes

Hashes for nose-pathmunge-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e9fe92878480d7bb6b116acb686cf72f6cb8bb12e24ad86fb2cc9ef25dad16b5
MD5 98e9f452d05579d7337185c3d671ed39
BLAKE2b-256 779faf78cb3d94eb3c2661119bc3dea19604164c298a0bf25f48ee211a399072

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page