Changeset f2cbeb7 in sasmodels


Ignore:
Timestamp:
Aug 7, 2017 7:09:11 AM (7 years ago)
Author:
lewis
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
f0e09d6
Parents:
724257c
Message:

Return unit test output as string in check_model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/model_test.py

    rbb4b509 rf2cbeb7  
    4747import sys 
    4848import unittest 
     49from StringIO import StringIO 
    4950 
    5051import numpy as np  # type: ignore 
     
    350351 
    351352    # Build a object to capture and print the test results 
    352     stream = _WritelnDecorator(sys.stdout)  # Add writeln() method to stream 
     353    stream = _WritelnDecorator(StringIO())  # Add writeln() method to stream 
    353354    verbosity = 2 
    354355    descriptions = True 
     
    388389    else: 
    389390        stream.writeln("Note: no test suite created --- this should never happen") 
     391 
     392    output = stream.getvalue() 
     393    stream.close() 
     394    return output 
    390395 
    391396 
Note: See TracChangeset for help on using the changeset viewer.