Closed briandleahy closed 4 years ago
Hey @briandleahy I have some code already in holopy (probably in multisphere?) that suppresses the print statements. It might be worthwhile to factor this out as a context manager and use that to suppress the additional printing during tests.
it's in holopy.scattering.theory.multisphere
, lines 186-206
Should be fixed. Now the test output is much tidier:
nosetests3
.................S......................................................S..........................................................................................S...S..................................................................................................................................................SSSSSSSSS...............................................................................................................................................................S
----------------------------------------------------------------------
Ran 483 tests in 42.485s
OK (SKIP=14)
I have a 2 questions / comments in the code before merging; see above.
In conversation with @briandleahy, we agreed to keep the Fortran output in stdout vs. stderr, since it's usually suppressed anyway. The context manager gives a convenient way to to hide/expose the output as necessary.
Thanks @barkls . I think maybe down the line we can edit the fortran code to output to stderr, but I don't think it's urgent now.
This PR primarily deals with some of the warnings and other stuff printed out to the console when the tests are run. Now there are only two tests which print out information to the console,
scattering.tets.test_lowlevel.test_multisphere_singlesph
andscattering.tets.test_lowlevel.test_asm
. Unfortunately, since the code that causes the print statements is in one of the C librariesholopy
uses, I can't suppress this without doing something drastic.As an example, the test output before these commits:
And after:
In addition, I fixed a few bugs in the tests (including one incorrectly failing test), expanded a test, and made some pep8 changes as well.
@barkls I know you're crippled right now but I'd love your feedback on this. If in person is easier lmk!