Changeset 9bc4882 in sasmodels for sasmodels/model_test.py
- Timestamp:
- Sep 5, 2017 11:01:03 AM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 8db25bf
- Parents:
- acc6c8f (diff), 142a8e2 (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
r73cbc5b r9bc4882 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.