New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TST: increase scipy.optimize test coverage for disp=True #4805
Conversation
os.devnull on windows?
|
os.devnull should be fine on windows. On Mon, May 4, 2015 at 12:49 PM, Pauli Virtanen notifications@github.com
|
numpy uses it... Edit: it exists on windows according to https://docs.python.org/2/library/os.html#os.devnull |
@@ -25,3 +26,19 @@ def deco(func): | |||
pass | |||
return dec.knownfailureif(True, msg)(func) | |||
return deco | |||
|
|||
|
|||
def suppressed_stdout(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point of this surrounding function if the decorator does not accept arguments? Unless I'm missing something, it could just be the underlying function suppressed_stdout_decorator
, which would be used simply as @suppressed_stdout
(no parentheses).
This is tricky to get right. I think Also see this context manager for redirecting stdout which may somehow be useful/informative: numpy/numpy#3128 |
+1 for this idea though. We may want to add this decorator to |
I don't know how to progress further with this PR, but I've opened a numpy issue numpy/numpy#5891. |
It's late and I haven't thought about this very hard, but I think your code is actually OK. |
If my comment above makes sense, and this PR works without generating any noise, maybe just merge it. Any issues have about 5 months until the next release to surface. |
TST: increase scipy.optimize test coverage for disp=True
OK I've merged it! |
This includes a new decorator in
_lib._testutils
for silencing output of specific tests, inspired by https://github.com/numpy/numpy/blob/master/numpy/testing/decorators.py and https://github.com/numpy/numpy/blob/maintenance/1.9.x/numpy/lib/tests/test_regression.py#L171, and it reorganizes the optimization tests by adding an object oriented hierarchy inspired by thescipy.sparse
test framework, replacingcloses #4804