#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# 'Run before each test method to initialize test environment.' #NEWLINE# super ( TestCase , self ) . setUp ( ) #NEWLINE# test_timeout = os . environ . get ( 'OS_TEST_TIMEOUT' , 0 ) #NEWLINE# try : #NEWLINE# #INDENT# test_timeout = int ( self ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# test_timeout = 0 #NEWLINE# #UNINDENT# if ( test_timeout > 0 ) : #NEWLINE# #INDENT# self . useFixture ( fixtures . Timeout ( test_timeout , gentle = True ) ) #NEWLINE# #UNINDENT# self . useFixture ( fixtures . NestedTempfile ( ) ) #NEWLINE# self . useFixture ( fixtures . TempHomeDir ( ) ) #NEWLINE# if ( os . environ . get ( 'OS_STDOUT_CAPTURE' ) in _TRUE_VALUES ) : #NEWLINE# #INDENT# stdout = self . useFixture ( fixtures . StringStream ( 'stdout' ) ) . stream #NEWLINE# self . useFixture ( fixtures . MonkeyPatch ( 'sys.stdout' , stdout ) ) #NEWLINE# #UNINDENT# if ( os . environ . get ( 'OS_STDERR_CAPTURE' ) in _TRUE_VALUES ) : #NEWLINE# #INDENT# stderr = self . useFixture ( fixtures . StringStream ( 'stderr' ) ) . stream #NEWLINE# self . useFixture ( fixtures . MonkeyPatch ( 'sys.stderr' , stderr ) ) #NEWLINE# #UNINDENT# self . log_fixture = self . useFixture ( fixtures . FakeLogger ( ) )