Home | History | Annotate | Download | only in test

Lines Matching refs:def

17     def __init__(self, gen):
23 def __enter__(self):
27 def __exit__(self, type, value, traceback):
34 def mock_contextmanager(func):
35 def helper(*args, **kwds):
41 def __init__(self):
47 def mock_contextmanager_generator():
58 def __init__(self, *managers):
62 def __enter__(self):
76 def __exit__(self, *exc_info):
93 def __init__(self, *managers):
99 def __enter__(self):
103 def __exit__(self, *exc_info):
110 def testNameError(self):
111 def fooNotDeclared():
115 def testEnterAttributeError(self):
117 def __exit__(self, type, value, traceback):
120 def fooLacksEnter():
125 def testExitAttributeError(self):
127 def __enter__(self):
130 def fooLacksExit():
135 def assertRaisesSyntaxError(self, codestr):
136 def shouldRaiseSyntaxError(s):
140 def testAssignmentToNoneError(self):
146 def testAssignmentToEmptyTupleError(self):
151 def testAssignmentToTupleOnlyContainingNoneError(self):
157 def testAssignmentToTupleContainingNoneError(self):
162 def testEnterThrows(self):
164 def __enter__(self):
166 def __exit__(self, *args):
169 def shouldThrow():
177 def testExitThrows(self):
179 def __enter__(self):
181 def __exit__(self, *args):
183 def shouldThrow():
191 def assertInWithManagerInvariants(self, mock_manager):
196 def assertAfterWithManagerInvariants(self, mock_manager, exit_args):
201 def assertAfterWithManagerInvariantsNoError(self, mock_manager):
205 def assertInWithGeneratorInvariants(self, mock_generator):
209 def assertAfterWithGeneratorInvariantsNoError(self, mock_generator):
213 def raiseTestException(self):
216 def assertAfterWithManagerInvariantsWithError(self, mock_manager,
228 def assertAfterWithGeneratorInvariantsWithError(self, mock_generator):
234 def testInlineGeneratorSyntax(self):
238 def testUnboundGenerator(self):
244 def testInlineGeneratorBoundSyntax(self):
250 def testInlineGeneratorBoundToExistingVariable(self):
256 def testInlineGeneratorBoundToDottedVariable(self):
261 def testBoundGenerator(self):
269 def testNestedSingleStatements(self):
288 def testSingleArgInlineGeneratorSyntax(self):
292 def testSingleArgBoundToNonTuple(self):
300 def testSingleArgBoundToSingleElementParenthesizedList(self):
308 def testSingleArgBoundToMultipleElementTupleError(self):
309 def shouldThrowValueError():
314 def testSingleArgUnbound(self):
323 def testMultipleArgUnbound(self):
338 def testMultipleArgBound(self):
353 def testSingleResource(self):
355 def shouldThrow():
364 def testExceptionNormalized(self):
366 def shouldThrow():
374 def testNestedSingleStatements(self):
377 def shouldThrow():
391 def testMultipleResourcesInSingleStatement(self):
395 def shouldThrow():
410 def testNestedExceptionBeforeInnerStatement(self):
414 def shouldThrow():
431 def testNestedExceptionAfterInnerStatement(self):
434 def
448 def testRaisedStopIteration1(self):
451 def cm():
454 def shouldThrow():
460 def testRaisedStopIteration2(self):
463 def __enter__(self):
465 def __exit__(self, type, value, traceback):
468 def shouldThrow():
474 def testRaisedStopIteration3(self):
478 def cm():
481 def shouldThrow():
487 def testRaisedGeneratorExit1(self):
490 def cm():
493 def shouldThrow():
499 def testRaisedGeneratorExit2(self):
502 def __enter__(self):
504 def __exit__(self, type, value, traceback):
507 def shouldThrow():
513 def testErrorsInBool(self):
518 def __init__(self, bool_conversion):
520 def __nonzero__(self):
523 def __enter__(self):
525 def __exit__(self, a, b, c):
528 def trueAsBool():
533 def falseAsBool():
538 def failAsBool():
546 def testWithBreak(self):
556 def testWithContinue(self):
568 def testWithReturn(self):
569 def foo():
579 def testWithYield(self):
580 def gen():
587 def testWithRaise(self):
603 def testSingleComplexTarget(self):
620 def testMultipleComplexTargets(self):
622 def __enter__(self): return 1, 2, 3
623 def __exit__(self, t, v, tb): pass
641 def testExitTrueSwallowsException(self):
643 def __enter__(self): pass
644 def __exit__(self, t, v, tb): return True
651 def testExitFalseDoesntSwallowException(self):
653 def __enter__(self): pass
654 def __exit__(self, t, v, tb): return False
667 def __init__(self, value=None, gobble=False):
675 def __enter__(self):
679 def __exit__(self, *exc_info):
686 def __init__(self): raise RuntimeError()
689 def __enter__(self): raise RuntimeError()
690 def __exit__(self, *exc_info): pass
693 def __enter__(self): pass
694 def __exit__(self, *exc_info): raise RuntimeError()
696 def testNoExceptions(self):
703 def testExceptionInExprList(self):
712 def testExceptionInEnter(self):
723 def testExceptionInExit(self):
732 def testEnterReturnsTuple(self):
740 def test_main():