.. scriptloader documentation master file, created by sphinx-quickstart on Wed Dec 22 16:04:28 2010. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. scriptloader loads scripts (into nose) ====================================== .. highlight:: none :mod:`scriptloader` is a tiny plugin for the `nose`_ testing tool for Python. With :mod:`scriptloader`, you can run nose on files that aren't usually importable (like scripts without the '.py' extension). Take a look:: $ cat /tmp/tests import unittest class TestFoo(unittest.TestCase): def test_easy(self): self.assertEqual(1 + 1, 2) $ nosetests /tmp/tests E ====================================================================== ERROR: Failure: ValueError (Unable to load tests from file /tmp/tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/will/share/venv/2.6/lib/python2.6/site-packages/nose/loader.py", line 206, in loadTestsFromFile % filename) ValueError: Unable to load tests from file /tmp/tests ---------------------------------------------------------------------- Ran 1 test in 0.003s FAILED (errors=1) witten:~ $ nosetests --with-scriptloader /tmp/tests . ---------------------------------------------------------------------- Ran 1 test in 0.003s OK .. _nose: http://somethingaboutorange.com/mrl/projects/nose/ .. note:: When run with Python interpreters that don't support :data:`sys.dont_write_bytecode` (ie, Python versions < 2.6), this plugin may cause a file named like the script under test with a 'c' extension to be created as a side effect of testing. See :func:`load_source` for more information. Installing :mod:`scriptloader` ------------------------------ .. highlight:: none You can install the latest stable version of :mod:`scriptloader` using :command:`pip`:: $ pip install scriptloader Public repositories for the project are hosted at `github`_ and `bitbucket`_, so you can use either `git`_ or `Mercurial`_ to get a copy of the project's code and history:: $ hg clone http://bitbucket.org/wcmaier/scriptloader $ git clone git://github.com/wcmaier/scriptloader.git .. _github: http://github.com/wcmaier/scriptloader .. _bitbucket: http://bitbucket.org/wcmaier/scriptloader .. _git: http://git-scm.com/ .. _Mercurial: http://mercurial.selenic.com/ If you notice a problem with :mod:`scriptloader`, please report it using the github `issue tracker`_ (or, if you have a fix, send a `pull request`_). .. _issue tracker: http://github.com/wcmaier/scriptloader/issues .. _pull request: http://github.com/wcmaier/scriptloader/pull/new/master A note about versions +++++++++++++++++++++ :mod:`scriptloader` is developed along two branches. The first, 'default' (or 'master' in git) contains new features and possible bugs -- this branch is the active development branch. The second, 'stable', contains releases both major and minor as well as bugfixes. If you'd like to help improve :mod:`scriptloader`, take a look at default/master. Otherwise, stick with stable. Guts ---- .. automodule:: scriptloader :members: :show-inheritance: