コード例 #1
0
ファイル: test___config.py プロジェクト: gevent/gevent
    def test_validate_bool(self):
        self.assertTrue(_config.validate_bool('on'))
        self.assertTrue(_config.validate_bool('1'))
        self.assertFalse(_config.validate_bool('off'))
        self.assertFalse(_config.validate_bool('0'))
        self.assertFalse(_config.validate_bool(''))

        with self.assertRaises(ValueError):
            _config.validate_bool(' hmm ')
コード例 #2
0
ファイル: test___config.py プロジェクト: sh9901/qa-gevent
    def test_validate_bool(self):
        self.assertTrue(_config.validate_bool('on'))
        self.assertTrue(_config.validate_bool('1'))
        self.assertFalse(_config.validate_bool('off'))
        self.assertFalse(_config.validate_bool('0'))
        self.assertFalse(_config.validate_bool(''))

        with self.assertRaises(ValueError):
            _config.validate_bool(' hmm ')
コード例 #3
0
ファイル: util.py プロジェクト: sidawater/gevent
import unittest
import threading
import subprocess
import time

from . import six
from gevent._config import validate_bool

# pylint: disable=broad-except,attribute-defined-outside-init

runtimelog = []
MIN_RUNTIME = 1.0
BUFFER_OUTPUT = False
# This is set by the testrunner, defaulting to true (be quiet)
# But if we're run standalone, default to false
QUIET = validate_bool(os.environ.get('GEVENTTEST_QUIET', '0'))


class Popen(subprocess.Popen):

    def __enter__(self):
        return self

    def __exit__(self, *args):
        kill(self)


# Coloring code based on zope.testrunner

# These colors are carefully chosen to have enough contrast
# on terminals with both black and white background.
コード例 #4
0
ファイル: util.py プロジェクト: gevent/gevent
import unittest
import threading
import subprocess
import time

from . import six
from gevent._config import validate_bool

# pylint: disable=broad-except,attribute-defined-outside-init

runtimelog = []
MIN_RUNTIME = 1.0
BUFFER_OUTPUT = False
# This is set by the testrunner, defaulting to true (be quiet)
# But if we're run standalone, default to false
QUIET = validate_bool(os.environ.get('GEVENTTEST_QUIET', '0'))


class Popen(subprocess.Popen):

    def __enter__(self):
        return self

    def __exit__(self, *args):
        kill(self)


# Coloring code based on zope.testrunner

# These colors are carefully chosen to have enough contrast
# on terminals with both black and white background.