Changeset 33e475a in sasmodels for sasmodels/model_test.py
- Timestamp:
- Aug 26, 2017 8:17:30 PM (7 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 573ffab
- Parents:
- d439007 (diff), bedb9b0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/model_test.py
rbb4b509 rbedb9b0 47 47 import sys 48 48 import unittest 49 50 try: 51 from StringIO import StringIO 52 except ImportError: 53 # StringIO.StringIO renamed to io.StringIO in Python 3 54 # Note: io.StringIO exists in python 2, but using unicode instead of str 55 from io import StringIO 49 56 50 57 import numpy as np # type: ignore … … 337 344 338 345 def run_one(model): 339 # type: (str) -> None346 # type: (str) -> str 340 347 """ 341 348 Run the tests for a single model, printing the results to stdout. … … 350 357 351 358 # Build a object to capture and print the test results 352 stream = _WritelnDecorator( sys.stdout) # Add writeln() method to stream359 stream = _WritelnDecorator(StringIO()) # Add writeln() method to stream 353 360 verbosity = 2 354 361 descriptions = True … … 388 395 else: 389 396 stream.writeln("Note: no test suite created --- this should never happen") 397 398 output = stream.getvalue() 399 stream.close() 400 return output 390 401 391 402
Note: See TracChangeset
for help on using the changeset viewer.