コード例 #1
0
 def wrapper(self, *args, **kwargs):
     initial_switch_count = getattr(_get_hub(), 'switch_count', None)
     self.switch_expected = getattr(self, 'switch_expected', True)
     if initial_switch_count is not None:
         fullname = getattr(self, 'fullname', None)
         if self.switch_expected == 'default' and fullname:
             self.switch_expected = get_switch_expected(fullname)
     result = method(self, *args, **kwargs)
     if initial_switch_count is not None and self.switch_expected is not None:
         switch_count = _get_hub().switch_count - initial_switch_count
         if self.switch_expected is True:
             assert switch_count >= 0
             if not switch_count:
                 raise AssertionError('%s did not switch' % fullname)
         elif self.switch_expected is False:
             if switch_count:
                 raise AssertionError('%s switched but not expected to' % fullname)
         else:
             raise AssertionError('Invalid value for switch_expected: %r' % (self.switch_expected, ))
     return result
コード例 #2
0
ファイル: greentest.py プロジェクト: Alex201310/gevent
 def wrapped(self, *args, **kwargs):
     initial_switch_count = getattr(_get_hub(), 'switch_count', None)
     self.switch_expected = getattr(self, 'switch_expected', True)
     if initial_switch_count is not None:
         fullname = getattr(self, 'fullname', None)
         if self.switch_expected == 'default' and fullname:
             self.switch_expected = get_switch_expected(fullname)
     result = method(self, *args, **kwargs)
     if initial_switch_count is not None and self.switch_expected is not None:
         switch_count = _get_hub().switch_count - initial_switch_count
         if self.switch_expected is True:
             assert switch_count >= 0
             if not switch_count:
                 raise AssertionError('%s did not switch' % fullname)
         elif self.switch_expected is False:
             if switch_count:
                 raise AssertionError('%s switched but not expected to' % fullname)
         else:
             raise AssertionError('Invalid value for switch_expected: %r' % (self.switch_expected, ))
     return result
コード例 #3
0
ファイル: greentest.py プロジェクト: ubuntuvim/GoAgent
 def wrapped(self, *args, **kwargs):
     initial_switch_count = getattr(_get_hub(), "switch_count", None)
     self.switch_expected = getattr(self, "switch_expected", True)
     if initial_switch_count is not None:
         fullname = getattr(self, "fullname", None)
         if self.switch_expected == "default" and fullname:
             self.switch_expected = get_switch_expected(fullname)
     result = method(self, *args, **kwargs)
     if initial_switch_count is not None and self.switch_expected is not None:
         switch_count = _get_hub().switch_count - initial_switch_count
         if self.switch_expected is True:
             assert switch_count >= 0
             if not switch_count:
                 raise AssertionError("%s did not switch" % fullname)
         elif self.switch_expected is False:
             if switch_count:
                 raise AssertionError("%s switched but not expected to" % fullname)
         else:
             raise AssertionError("Invalid value for switch_expected: %r" % (self.switch_expected,))
     return result
コード例 #4
0
ファイル: greentest.py プロジェクト: winnerineast/gevent
 def run(self, *args, **kwargs):
     # pylint:disable=arguments-differ
     if self.switch_expected == 'default':
         self.switch_expected = get_switch_expected(self.fullname)
     return BaseTestCase.run(self, *args, **kwargs)
コード例 #5
0
ファイル: greentest.py プロジェクト: novator24/zgevent
 def run(self, *args, **kwargs):
     if self.switch_expected == 'default':
         self.switch_expected = get_switch_expected(self.fullname)
     return BaseTestCase.run(self, *args, **kwargs)
コード例 #6
0
ファイル: greentest.py プロジェクト: Alex201310/gevent
 def run(self, *args, **kwargs):
     if self.switch_expected == 'default':
         self.switch_expected = get_switch_expected(self.fullname)
     return BaseTestCase.run(self, *args, **kwargs)