[TIP] Fwd: Trying to make nose use a different TestSuite

Vijayram Gopu vijayram at dssd.com
Thu Oct 1 17:12:20 PDT 2015

I implemented a plugin to make Nosetests use a different TestSuite... below
is my implementation and errors during execution, any suggestion or pointer
will be greatly appreciated,

---------- MyPlugin --------------

class CaptureExecResults(Plugin, unittest.TestCase):

    enabled = True

    name = 'suite-loader'

    def configure(self, options, conf):

        Plugin.configure(self, options, conf)

        print "--- Into configure"

        names = ["UserManagementTestSuite.faas_runtime_error"]

        self.suite = nose.loader.TestLoader().loadTestsFromNames(names,

        #self.suite = unittest.TestLoader().loadTestsFromNames(names, mod1)

        print self.suite

    def prepareTestLoader(self, loader):

        print "--- prepareTestLoader.."

        loader.suiteClass = self.suite

I am getting errors during execution....

  File "/opt/tools/lib/python2.7/site-packages/nose/loader.py", line 355,
in loadTestsFromModule

    return self.suiteClass(ContextList(tests, context=module))

  File "/opt/tools/lib/python2.7/site-packages/nose/suite.py", line 177, in

    return self.run(*arg, **kw)

  File "/opt/tools/lib/python2.7/site-packages/nose/suite.py", line 218, in

    if result.shouldStop:

  File "/opt/tools/lib/python2.7/site-packages/nose/proxy.py", line 30, in

    return getattr(getattr(self, local_attr), proxied_attr)

AttributeError: 'ContextList' object has no attribute 'shouldStop'

Any suggestion or pointer...

Thank you so much,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20151001/f501ba46/attachment.htm>

More information about the testing-in-python mailing list