From 8454220adcb1ea47cb8a25e359e310513ee8913a Mon Sep 17 00:00:00 2001 From: clowwindy Date: Fri, 31 Oct 2014 15:02:12 +0800 Subject: [PATCH] update unit test --- .travis.yml | 2 +- tests/nose_plugin.py | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tests/nose_plugin.py diff --git a/.travis.yml b/.travis.yml index 46419ea18..a430a7154 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ before_install: - sudo tests/socksify/install.sh script: - pep8 . - - nosetests shadowsocks/* + - python tests/nose_plugin.py - python tests/test.py -c tests/table.json - python tests/test.py -c tests/aes.json - python tests/test.py -c tests/aes-ctr.json diff --git a/tests/nose_plugin.py b/tests/nose_plugin.py new file mode 100644 index 000000000..1db63515c --- /dev/null +++ b/tests/nose_plugin.py @@ -0,0 +1,27 @@ +import sys +import nose +from nose.plugins.base import Plugin + +class ExtensionPlugin(Plugin): + + name = "ExtensionPlugin" + + def options(self, parser, env): + Plugin.options(self,parser,env) + + def configure(self, options, config): + Plugin.configure(self, options, config) + self.enabled = True + + def wantFile(self, file): + return file.endswith('.py') + + def wantDirectory(self,directory): + return True + + def wantModule(self,file): + return True + + +if __name__ == '__main__': + nose.main(addplugins=[ExtensionPlugin()]) \ No newline at end of file