Skip to content

Use PYTHONFAULTHANDLER to switch on the Python fault handler. #13937

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

Merged
merged 1 commit into from
Aug 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ clone_depth: 50
environment:

global:
PYTHONFAULTHANDLER: 1
PYTHONIOENCODING: UTF-8
PYTEST_ARGS: -raR --numprocesses=auto --timeout=300 --durations=25
--cov-report= --cov=lib --log-level=DEBUG
Expand Down
6 changes: 1 addition & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,21 @@ jobs:
architecture: 'x64'

- script: |

python -m pip install --upgrade pip
pip install -r requirements/testing/travis_all.txt -r requirements/testing/travis36.txt

displayName: 'Install dependencies'

- script: |

export MPLLOCALFREETYPE=1
pip install -ve .

displayName: "Install self"

- script: env
displayName: 'print env'

- script: |
env
pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 --log-level=DEBUG
PYTHONFAULTHANDLER=1 pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 --log-level=DEBUG
displayName: 'pytest'

- task: PublishTestResults@2
Expand Down
4 changes: 4 additions & 0 deletions doc/api/next_api_changes/2019-04-13-AL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The test suite no longer turns on the Python fault handler by default
`````````````````````````````````````````````````````````````````````

Set the standard ``PYTHONFAULTHANDLER`` environment variable to do so.
10 changes: 0 additions & 10 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1350,16 +1350,6 @@ def tk_window_focus():


def _init_tests():
# CPython's faulthandler since v3.6 handles exceptions on Windows
# https://bugs.python.org/issue23848 but until v3.6.4 it was printing
# non-fatal exceptions https://bugs.python.org/issue30557
import platform
if not (sys.platform == 'win32' and
(3, 6) < sys.version_info < (3, 6, 4) and
platform.python_implementation() == 'CPython'):
import faulthandler
faulthandler.enable()

# The version of FreeType to install locally for running the
# tests. This must match the value in `setupext.py`
LOCAL_FREETYPE_VERSION = '2.6.1'
Expand Down
1 change: 0 additions & 1 deletion requirements/testing/travis_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pillow
pyparsing
pytest
pytest-cov
pytest-faulthandler
pytest-rerunfailures
pytest-timeout
pytest-xdist
Expand Down