diff --git a/hypothesis-python/RELEASE.rst b/hypothesis-python/RELEASE.rst new file mode 100644 index 0000000000..bc0a73c557 --- /dev/null +++ b/hypothesis-python/RELEASE.rst @@ -0,0 +1,4 @@ +RELEASE_TYPE: patch + +This patch fixes a warning under :pypi:`pytest` 7 relating to our +rich traceback display logic (:issue:`3223`). diff --git a/hypothesis-python/src/hypothesis/internal/escalation.py b/hypothesis-python/src/hypothesis/internal/escalation.py index 1935f87e66..d1cb46d93b 100644 --- a/hypothesis-python/src/hypothesis/internal/escalation.py +++ b/hypothesis-python/src/hypothesis/internal/escalation.py @@ -133,9 +133,13 @@ def get_interesting_origin(exception): def _get_exceptioninfo(): # ExceptionInfo was moved to the top-level namespace in Pytest 7.0 - for module in ["pytest", "_pytest._code"]: + if "pytest" in sys.modules: with contextlib.suppress(Exception): - return sys.modules[module].ExceptionInfo + # From Pytest 7, __init__ warns on direct calls. + return sys.modules["pytest"].ExceptionInfo.from_exc_info + if "_pytest._code" in sys.modules: # pragma: no cover # old versions only + with contextlib.suppress(Exception): + return sys.modules["_pytest._code"].ExceptionInfo return None # pragma: no cover # coverage tests always use pytest diff --git a/hypothesis-python/src/hypothesis/vendor/tlds-alpha-by-domain.txt b/hypothesis-python/src/hypothesis/vendor/tlds-alpha-by-domain.txt index 4fd10eca3a..1a447ce515 100644 --- a/hypothesis-python/src/hypothesis/vendor/tlds-alpha-by-domain.txt +++ b/hypothesis-python/src/hypothesis/vendor/tlds-alpha-by-domain.txt @@ -1,4 +1,4 @@ -# Version 2022021200, Last Updated Sat Feb 12 07:07:01 2022 UTC +# Version 2022021900, Last Updated Sat Feb 19 07:07:02 2022 UTC AAA AARP ABARTH @@ -176,7 +176,6 @@ BROTHER BRUSSELS BS BT -BUDAPEST BUGATTI BUILD BUILDERS diff --git a/requirements/coverage.txt b/requirements/coverage.txt index 1393beebe5..d41023803d 100644 --- a/requirements/coverage.txt +++ b/requirements/coverage.txt @@ -12,7 +12,7 @@ backports-zoneinfo==0.2.1 # via -r requirements/coverage.in black==22.1.0 # via -r requirements/coverage.in -click==8.0.3 +click==8.0.4 # via # -r requirements/coverage.in # black @@ -24,7 +24,7 @@ dpcontracts==0.6.0 # via -r requirements/coverage.in execnet==1.9.0 # via pytest-xdist -fakeredis==1.7.0 +fakeredis==1.7.1 # via -r requirements/coverage.in iniconfig==1.1.1 # via pytest @@ -44,13 +44,14 @@ packaging==21.3 # via # fakeredis # pytest + # redis pandas==1.4.1 # via -r requirements/coverage.in pathspec==0.9.0 # via black pexpect==4.8.0 # via -r requirements/test.in -platformdirs==2.5.0 +platformdirs==2.5.1 # via black pluggy==1.0.0 # via pytest @@ -81,7 +82,7 @@ pytz==2021.3 # pandas pyyaml==6.0 # via libcst -redis==4.0.2 +redis==4.1.4 # via fakeredis six==1.16.0 # via @@ -95,7 +96,7 @@ tomli==2.0.1 # via # black # pytest -typing-extensions==4.1.0 +typing-extensions==4.1.1 # via # -r requirements/coverage.in # black diff --git a/requirements/tools.txt b/requirements/tools.txt index cef323ebd2..47fd4ced1e 100644 --- a/requirements/tools.txt +++ b/requirements/tools.txt @@ -41,7 +41,7 @@ cffi==1.15.0 # via cryptography charset-normalizer==2.0.12 # via requests -click==8.0.3 +click==8.0.4 # via # black # pip-tools @@ -71,7 +71,7 @@ dpcontracts==0.6.0 # via -r requirements/tools.in executing==0.8.2 # via stack-data -filelock==3.4.2 +filelock==3.6.0 # via # tox # virtualenv @@ -110,7 +110,7 @@ flake8-noqa==1.2.1 # via -r requirements/tools.in flake8-polyfill==1.0.2 # via flake8-bandit -flake8-simplify==0.16.0 +flake8-simplify==0.17.1 # via -r requirements/tools.in flake8-strftime==0.3.2 # via -r requirements/tools.in @@ -122,7 +122,7 @@ idna==3.3 # via requests imagesize==1.3.0 # via sphinx -importlib-metadata==4.11.0 +importlib-metadata==4.11.1 # via # keyring # sphinx @@ -149,7 +149,7 @@ libcst==0.4.1 # via # -r requirements/tools.in # shed -markupsafe==2.0.1 +markupsafe==2.1.0 # via jinja2 matplotlib-inline==0.1.3 # via ipython @@ -184,7 +184,7 @@ pip-tools==6.5.1 # via -r requirements/tools.in pkginfo==1.8.2 # via twine -platformdirs==2.5.0 +platformdirs==2.5.1 # via # black # virtualenv @@ -249,7 +249,7 @@ rfc3986==2.0.0 # via twine secretstorage==3.3.1 # via keyring -shed==0.9.0 +shed==0.9.1 # via -r requirements/tools.in six==1.16.0 # via @@ -295,7 +295,7 @@ sphinxcontrib-serializinghtml==1.1.5 # via sphinx sqlparse==0.4.2 # via django -stack-data==0.1.4 +stack-data==0.2.0 # via ipython stevedore==3.5.0 # via bandit @@ -325,11 +325,11 @@ types-click==7.1.8 # via -r requirements/tools.in types-pkg-resources==0.1.3 # via -r requirements/tools.in -types-pytz==2021.3.4 +types-pytz==2021.3.5 # via -r requirements/tools.in -types-redis==4.1.15 +types-redis==4.1.16 # via -r requirements/tools.in -typing-extensions==4.1.0 +typing-extensions==4.1.1 # via # black # flake8-noqa diff --git a/tooling/src/hypothesistooling/__main__.py b/tooling/src/hypothesistooling/__main__.py index 3a504873fb..76cef32052 100644 --- a/tooling/src/hypothesistooling/__main__.py +++ b/tooling/src/hypothesistooling/__main__.py @@ -16,12 +16,13 @@ from glob import glob from urllib.parse import urlparse +import requests +from coverage.config import CoverageConfig + import hypothesistooling as tools import hypothesistooling.projects.conjecturerust as cr import hypothesistooling.projects.hypothesispython as hp import hypothesistooling.projects.hypothesisruby as hr -import requests -from coverage.config import CoverageConfig from hypothesistooling import installers as install, releasemanagement as rm from hypothesistooling.scripts import pip_tool diff --git a/tooling/src/hypothesistooling/projects/hypothesispython.py b/tooling/src/hypothesistooling/projects/hypothesispython.py index 7913b54de0..9c0c342e29 100644 --- a/tooling/src/hypothesistooling/projects/hypothesispython.py +++ b/tooling/src/hypothesistooling/projects/hypothesispython.py @@ -14,8 +14,9 @@ import subprocess import sys -import hypothesistooling as tools import requests + +import hypothesistooling as tools from hypothesistooling import releasemanagement as rm PACKAGE_NAME = "hypothesis-python" diff --git a/whole-repo-tests/test_deploy.py b/whole-repo-tests/test_deploy.py index dd235121c6..50d417f338 100644 --- a/whole-repo-tests/test_deploy.py +++ b/whole-repo-tests/test_deploy.py @@ -10,8 +10,9 @@ import os -import hypothesistooling as tools import pytest + +import hypothesistooling as tools from hypothesistooling import __main__ as main, releasemanagement as rm diff --git a/whole-repo-tests/test_release_files.py b/whole-repo-tests/test_release_files.py index f18dbe6759..251ffba3f4 100644 --- a/whole-repo-tests/test_release_files.py +++ b/whole-repo-tests/test_release_files.py @@ -8,8 +8,9 @@ # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. -import hypothesistooling as tools import pytest + +import hypothesistooling as tools from hypothesistooling import releasemanagement as rm diff --git a/whole-repo-tests/test_release_management.py b/whole-repo-tests/test_release_management.py index 1836a96b0c..d02563fc76 100644 --- a/whole-repo-tests/test_release_management.py +++ b/whole-repo-tests/test_release_management.py @@ -9,6 +9,7 @@ # obtain one at https://mozilla.org/MPL/2.0/. import pytest + from hypothesistooling.releasemanagement import ( bump_version_info, parse_release_file_contents, diff --git a/whole-repo-tests/test_type_hints.py b/whole-repo-tests/test_type_hints.py index fedf21ad71..85130b8157 100644 --- a/whole-repo-tests/test_type_hints.py +++ b/whole-repo-tests/test_type_hints.py @@ -12,6 +12,7 @@ import subprocess import pytest + from hypothesistooling.projects.hypothesispython import PYTHON_SRC from hypothesistooling.scripts import pip_tool, tool_path