-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Time out in _get_executable_info #30256
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
Conversation
e095401
to
38a4c3b
Compare
|
||
|
||
@patch('matplotlib.subprocess.check_output') | ||
def test_get_executable_info_timeout(mock_check_output): |
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.
You could use monkeypatch
here, though I have no preference here.
066ecd9
to
50f6881
Compare
mock_check_output.side_effect = subprocess.TimeoutExpired(cmd=['mock'], timeout=30) | ||
|
||
with pytest.raises(matplotlib.ExecutableNotFoundError, match='Timed out'): | ||
print(matplotlib._get_executable_info.__wrapped__('inkscape')) |
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.
the print is a bit weird here (even though it will not actually ever run, of course -- it just statically reads weird to me)
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.
I found it useful when trying to get the patch argument right, but of course it isn't necessary now.
Time out after 30 seconds. This is used for version queries which should be very fast, so a 30-second delay would be unusual. GitHub Actions test runs have been hanging trying to get the inkscape version when using Python 3.14: https://github.com/matplotlib/matplotlib/actions/runs/16043158943/job/45268507848#step:13:836
50f6881
to
6a01311
Compare
Time out after 30 seconds. This is used for version queries which
should be very fast, so a 30-second delay would be unusual.
GitHub Actions test runs have been hanging trying to get the
inkscape version when using Python 3.14:
https://github.com/matplotlib/matplotlib/actions/runs/16043158943/job/45268507848#step:13:836
PR summary
PR checklist