Skip to content

Commit 40b0b74

Browse files
committed
Use PYTHONFAULTHANDLER to switch on the Python fault handler.
We don't need custom code in test() or a pytest plugin to do so. (That variable is already set in travis.yml.)
1 parent dd18211 commit 40b0b74

File tree

5 files changed

+6
-16
lines changed

5 files changed

+6
-16
lines changed

.appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ clone_depth: 50
1414
environment:
1515

1616
global:
17+
PYTHONFAULTHANDLER: 1
1718
PYTHONIOENCODING: UTF-8
1819
PYTEST_ARGS: -raR --numprocesses=auto --timeout=300 --durations=25
1920
--cov-report= --cov=lib --log-level=DEBUG

azure-pipelines.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,21 @@ jobs:
2323
architecture: 'x64'
2424

2525
- script: |
26-
2726
python -m pip install --upgrade pip
2827
pip install -r requirements/testing/travis_all.txt -r requirements/testing/travis36.txt
29-
3028
displayName: 'Install dependencies'
3129
3230
- script: |
33-
3431
export MPLLOCALFREETYPE=1
3532
pip install -ve .
36-
3733
displayName: "Install self"
3834
3935
- script: env
4036
displayName: 'print env'
4137

4238
- script: |
4339
env
44-
pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 --log-level=DEBUG
40+
PYTHONFAULTHANDLER=1 pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 --log-level=DEBUG
4541
displayName: 'pytest'
4642
4743
- task: PublishTestResults@2
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The test suite no longer turns on the Python fault handler by default
2+
`````````````````````````````````````````````````````````````````````
3+
4+
Set the standard ``PYTHONFAULTHANDLER`` environment variable to do so.

lib/matplotlib/__init__.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,16 +1350,6 @@ def tk_window_focus():
13501350

13511351

13521352
def _init_tests():
1353-
# CPython's faulthandler since v3.6 handles exceptions on Windows
1354-
# https://bugs.python.org/issue23848 but until v3.6.4 it was printing
1355-
# non-fatal exceptions https://bugs.python.org/issue30557
1356-
import platform
1357-
if not (sys.platform == 'win32' and
1358-
(3, 6) < sys.version_info < (3, 6, 4) and
1359-
platform.python_implementation() == 'CPython'):
1360-
import faulthandler
1361-
faulthandler.enable()
1362-
13631353
# The version of FreeType to install locally for running the
13641354
# tests. This must match the value in `setupext.py`
13651355
LOCAL_FREETYPE_VERSION = '2.6.1'

requirements/testing/travis_all.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ pillow
88
pyparsing
99
pytest
1010
pytest-cov
11-
pytest-faulthandler
1211
pytest-rerunfailures
1312
pytest-timeout
1413
pytest-xdist

0 commit comments

Comments
 (0)