added exit_unless_twisted function to greentest; moved my code from test_support.py to greentest/__init__.py
This commit is contained in:
@@ -1 +1,13 @@
|
||||
# package is named greentest, not test, so it won't be confused with test in stdlib
|
||||
# package is named greentest, not test, so it won't be confused with test in stdlib
|
||||
import sys
|
||||
|
||||
disabled_marker = '-*-*-*-*-*- disabled -*-*-*-*-*-'
|
||||
def exit_disabled():
|
||||
sys.exit(disabled_marker)
|
||||
|
||||
def exit_unless_twisted():
|
||||
from eventlet.api import get_hub
|
||||
if 'Twisted' not in type(get_hub()).__name__:
|
||||
exit_disabled()
|
||||
|
||||
|
||||
|
@@ -7,7 +7,7 @@ import sys
|
||||
import os
|
||||
import sqlite3
|
||||
import warnings
|
||||
from greentest.test_support import disabled_marker
|
||||
from greentest import disabled_marker
|
||||
|
||||
warnings.simplefilter('ignore')
|
||||
|
||||
|
@@ -1,14 +1,12 @@
|
||||
from twisted.internet import reactor
|
||||
from greentest import exit_unless_twisted
|
||||
exit_unless_twisted()
|
||||
import sys
|
||||
import unittest
|
||||
from twisted.internet.error import DNSLookupError
|
||||
from twisted.internet import defer
|
||||
from twisted.python.failure import Failure
|
||||
from eventlet.twistedutil import block_on
|
||||
from eventlet.api import get_hub
|
||||
from greentest.test_support import exit_disabled
|
||||
|
||||
if 'Twisted' not in type(get_hub()).__name__:
|
||||
exit_disabled()
|
||||
|
||||
class Test(unittest.TestCase):
|
||||
|
||||
|
@@ -5,10 +5,6 @@ if __name__ != 'greentest.test_support':
|
||||
|
||||
import sys
|
||||
|
||||
disabled_marker = '-*-*-*-*-*- disabled -*-*-*-*-*-'
|
||||
def exit_disabled():
|
||||
sys.exit(disabled_marker)
|
||||
|
||||
class Error(Exception):
|
||||
"""Base class for regression test exceptions."""
|
||||
|
||||
|
Reference in New Issue
Block a user