File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,13 @@ def printResult(res):
115115 # working directory is not within it.
116116 os .chdir (olddir )
117117 common .force_delete_dir (temp_dir )
118+
119+ # Since we are returning this result to the main thread we need to make sure
120+ # that it is serializable/picklable. To do this, we delete any non-picklable
121+ # fields from the instance.
122+ del result ._original_stdout
123+ del result ._original_stderr
124+
118125 return result
119126
120127
@@ -333,11 +340,6 @@ def stopTest(self, test):
333340 # TODO(sbc): figure out a way to display this duration information again when
334341 # these results get passed back to the TextTestRunner/TextTestResult.
335342 self .buffered_result .duration = self .test_duration
336- # Once we are done running the test and any stdout/stderr buffering has
337- # being taking care or, we delete these fields which the parent class uses.
338- # This is because they are not picklable (serializable).
339- del self ._original_stdout
340- del self ._original_stderr
341343
342344 def addSuccess (self , test ):
343345 super ().addSuccess (test )
You can’t perform that action at this time.
0 commit comments