forked from ip-tools/patzilla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntests.py
33 lines (28 loc) · 1.01 KB
/
runtests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# https://github.com/nltk/nltk/blob/develop/nltk/test/runtests.py
import sys
import nose
import logging
from nose.plugins.manager import PluginManager
from nose.plugins.doctests import Doctest
from nose.plugins import builtin
from nose_exclude import NoseExclude
from patzilla.util.test.doctest_nose_plugin import DoctestFix
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
class CustomPluginManager(PluginManager):
"""
Nose plugin manager that replaces standard doctest plugin with a patched version.
"""
def loadPlugins(self):
for plug in builtin.plugins:
if plug != Doctest:
self.addPlugin(plug())
self.addPlugin(DoctestFix())
self.addPlugin(NoseExclude())
super(CustomPluginManager, self).loadPlugins()
manager = CustomPluginManager()
manager.loadPlugins()
args = sys.argv[1:]
nose.run(argv=args, plugins=manager.plugins)