[svn r59615] given the format and the fact that external timeout logic may kill a py.test emitting a resultlog switching to line buffering
seems a good idea --HG-- branch : trunk
This commit is contained in:
		
							parent
							
								
									03f51e5edb
								
							
						
					
					
						commit
						c52d8bcdde
					
				|  | @ -28,7 +28,7 @@ class ResultLog(object): | |||
| 
 | ||||
|     def __init__(self, bus, logfile): | ||||
|         bus.subscribe(self.log_event_to_file) | ||||
|         self.logfile = logfile #open(logpath, 'w') # line buffering ? | ||||
|         self.logfile = logfile # preferably line buffered | ||||
| 
 | ||||
|     def write_log_entry(self, shortrepr, name, longrepr): | ||||
|         print >>self.logfile, "%s %s" % (shortrepr, name) | ||||
|  |  | |||
|  | @ -37,7 +37,7 @@ class Session(object): | |||
|             self.bus.subscribe(eventwrite) | ||||
|         resultlog = self.config.option.resultlog | ||||
|         if resultlog: | ||||
|             f = py.path.local(resultlog).open('w') | ||||
|             f = open(resultlog, 'w', 1) # line buffered | ||||
|             self.resultlog = ResultLog(self.bus, f) | ||||
| 
 | ||||
|     def fixoptions(self): | ||||
|  |  | |||
|  | @ -197,8 +197,6 @@ class TestSessionAndOptions(suptest.FileCreation): | |||
|        | ||||
|         session.bus.notify(rep_ev) | ||||
|          | ||||
|         session.resultlog.logfile.flush() | ||||
|          | ||||
|         s = resultlog.read() | ||||
|         assert s.find(". a") != -1         | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue