#NEWLINE# def test_concurrentImplicitWorkingDirectory( self ) : #NEWLINE# #INDENT# '\n        If no working directory is explicitly specified and the default\n        working directory is in use by another runner, L{TrialRunner.run}\n        selects a different default working directory to use.\n        ' #NEWLINE# self . parseOptions ( [ ] ) #NEWLINE# self . addCleanup ( os . chdir , os . getcwd ( ) ) #NEWLINE# runDirectory = FilePath ( self . mktemp ( ) ) #NEWLINE# runDirectory . makedirs ( ) #NEWLINE# os . chdir ( runDirectory . path ) #NEWLINE# firstRunner = self . getRunner ( ) #NEWLINE# secondRunner = self . getRunner ( ) #NEWLINE# where = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# class ConcurrentCase ( unittest . TestCase ) : #NEWLINE# #INDENT# def test_first( self ) : #NEWLINE# #INDENT# '\n                Start a second test run which will have a default working\n                directory which is the same as the working directory of the\n                test run already in progress.\n                ' #NEWLINE# where [ 'concurrent' ] = subsequentDirectory = os . getcwd ( ) #NEWLINE# os . chdir ( runDirectory . path ) #NEWLINE# self . addCleanup ( os . chdir , subsequentDirectory ) #NEWLINE# secondRunner . run ( ConcurrentCase ( 'test_second' ) ) #NEWLINE# #UNINDENT# def test_second( self ) : #NEWLINE# #INDENT# '\n                Record the working directory for later analysis.\n                ' #NEWLINE# where [ 'record' ] = os . getcwd ( ) #NEWLINE# #UNINDENT# #UNINDENT# result = firstRunner . run ( ConcurrentCase ( 'test_first' ) ) #NEWLINE# bad = ( result . errors + result . failures ) #NEWLINE# if bad : #NEWLINE# #INDENT# self . fail ( bad [ 0 ] [ 1 ] ) #NEWLINE# #UNINDENT# self . assertEqual ( where , { #NEWLINE# #INDENT# 'concurrent' : runDirectory . child ( '_trial_temp' ) . path , #NEWLINE# 'record' : runDirectory . child ( '_trial_temp-1' ) . path , #NEWLINE# #UNINDENT# } )