jazzband / django-nose

Django test runner using nose
http://pypi.python.org/pypi/django-nose
BSD 3-Clause "New" or "Revised" License
882 stars 234 forks source link

plugin options not working since 1.4.4 #287

Open X-Trade opened 7 years ago

X-Trade commented 7 years ago

I have a simple plugin that looks like this:

class UnitTestsSelectionPlugin(Plugin):
    enabled = True
    include_integration = False

    def options(self, parser, env):
        Plugin.options(self, parser, env)
        parser.add_option('--with-integration', action='store_true',
                          dest='include_integration', default=False,
                          help="Run integration tests alongside unit tests")

    def configure(self, options, conf):
        Plugin.configure(self, options, conf)
        self.include_integration = getattr(options, "include_integration",
                                           False)

This worked up to 1.4.3, but in 1.4.4 and 1.4.5 django test returns:

Usage: ./bin/django test [options] [path.to.modulename|path.to.modulename.TestCase|path.to.modulename.TestCase.test_method]...

Discover and run tests in the specified modules or the current directory.
./bin/django: error: no such option: --with-integration

I have checked that the plugin is properly installed and determined with crude prints that the configure and options methods are being called. Rolling back to an older version of django-nose fixes the problem.

The plugin was pretty much just lifted from the nose documentation.