Commits

Anonymous committed 5cf8477

addOption gets called twice, apparently.

  • Participants
  • Parent commits 6c9f7b1

Comments (0)

Files changed (2)

File docs/plugins/doctests.rst

 
 .. autoplugin :: nose2.plugins.doctests.DocTestLoader
 
+

File nose2/sphinxext.py

 
 class OptBucket(object):
     def __init__(self, doc=None, prog='nosetests'):
+        self.seen = set()
         self.opts = []
         self.doc = doc
         self.prog = prog
         return self.doc.replace('%prog', self.prog).replace(':\n', '::\n')
 
     def add_option(self, *arg, **kw):
-        self.opts.append(Opt(*arg, **kw))
+        if not arg in self.seen:
+            self.opts.append(Opt(*arg, **kw))
+            self.seen.add(arg)
 
     def __call__(self, callback, opt=None, longOpt=None, help=None):
         opts = []