Changes in / [ba2ed54:7a3f840] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/model_test.py

    rbb4b509 r9826f82  
    4747import sys 
    4848import unittest 
     49 
     50try: 
     51    from StringIO import StringIO 
     52except ImportError: # StringIO.StringIO renamed to io.StringIO in Python 3 
     53    from io import StringIO 
    4954 
    5055import numpy as np  # type: ignore 
     
    350355 
    351356    # Build a object to capture and print the test results 
    352     stream = _WritelnDecorator(sys.stdout)  # Add writeln() method to stream 
     357    stream = _WritelnDecorator(StringIO())  # Add writeln() method to stream 
    353358    verbosity = 2 
    354359    descriptions = True 
     
    388393    else: 
    389394        stream.writeln("Note: no test suite created --- this should never happen") 
     395 
     396    output = stream.getvalue() 
     397    stream.close() 
     398    return output 
    390399 
    391400 
Note: See TracChangeset for help on using the changeset viewer.