Added gevent as parameter to testall checking test suite with gevent

enabled/disabled
This commit is contained in:
Pedro Vicente 2012-11-12 13:48:20 +01:00
parent 1a2b404076
commit b0c50b7a59

View file

@ -1,7 +1,11 @@
#!/usr/bin/env python #!/usr/bin/env python
import os
import sys import sys
if len(sys.argv)>1 and sys.argv[1].lower() == 'gevent':
from gevent import monkey
monkey.patch_all()
import os
import logging import logging
import unittest import unittest
import distutils.core import distutils.core
@ -57,7 +61,7 @@ class TestCommand(distutils.core.Command):
if __name__ == '__main__': if __name__ == '__main__':
result = run_tests() result = run_tests()
print("<tests %s ran='%s' errors='%s' fails='%s' success='%s' />" % ( print("<tests %s ran='%s' errors='%s' fails='%s' success='%s' gevent_enabled=%s/>" % (
"xmlns='http//andyet.net/protocol/tests'", "xmlns='http//andyet.net/protocol/tests'",
result.testsRun, len(result.errors), result.testsRun, len(result.errors),
len(result.failures), result.wasSuccessful())) len(result.failures), result.wasSuccessful(),'gevent' in sys.modules))