diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index d17dd3bad..7b7815764 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -262,7 +262,7 @@ if [ -z "$GREEN_FRAMEWORK" ]; then # causing this script to exit. python -c "from bson import _cbson; from pymongo import _cmessage" fi - python -m pytest -v $TEST_ARGS + python -m pytest -v --durations=5 --maxfail=10 $TEST_ARGS else python green_framework_test.py $GREEN_FRAMEWORK -v $TEST_ARGS fi diff --git a/pytest.ini b/pytest.ini index dd1ab56a5..e10d24558 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,3 +3,4 @@ testpaths = test norecursedirs = test/* addopts = -ra --junitxml=xunit-results/TEST-results.xml +faulthandler_timeout = 1500 diff --git a/test/__init__.py b/test/__init__.py index 846d4a279..9792504a5 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -56,15 +56,6 @@ from pymongo.uri_parser import parse_uri if HAVE_SSL: import ssl -try: - # Enable the fault handler to dump the traceback of each running thread - # after a segfault. - import faulthandler - - faulthandler.enable() -except ImportError: - pass - # Enable debug output for uncollectable objects. PyPy does not have set_debug. if hasattr(gc, "set_debug"): gc.set_debug( diff --git a/tox.ini b/tox.ini index 221738015..c0fafb251 100644 --- a/tox.ini +++ b/tox.ini @@ -47,7 +47,7 @@ deps = pytest>=7 commands = python --version - pytest -v {posargs} + pytest -v --durations=5 --maxfail=10 {posargs} [testenv:test-eg] description = run tests using run-tests.sh Evergreen script @@ -152,7 +152,7 @@ deps = https://github.com/ajdavis/mongo-mockup-db/archive/master.zip passenv = * commands = - python -m pytest -v {posargs} ./test/mockupdb + {[testenv:test]commands} {posargs} ./test/mockupdb [testenv:aws-secrets] deps =