diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cbeaf5f..44201cea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - "pypy3.9" - "pypy3.10" - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -70,6 +70,7 @@ jobs: # Be wary of running `pip install` here, since it becomes easy for us to # accidentally pick up typing_extensions as installed by a dependency cd src + python --version # just to make sure we're running the right one python -m unittest test_typing_extensions.py - name: Test CPython typing test suite diff --git a/.github/workflows/third_party.yml b/.github/workflows/third_party.yml index 5f444c9f..f946b765 100644 --- a/.github/workflows/third_party.yml +++ b/.github/workflows/third_party.yml @@ -312,7 +312,7 @@ jobs: checkout-ref: [ "main", "rel_2_0" ] # sqlalchemy tests fail when using the Ubuntu 24.04 runner # https://github.com/sqlalchemy/sqlalchemy/commit/8d73205f352e68c6603e90494494ef21027ec68f - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: Setup Python diff --git a/src/test_typing_extensions.py b/src/test_typing_extensions.py index da4e3e44..e8d07813 100644 --- a/src/test_typing_extensions.py +++ b/src/test_typing_extensions.py @@ -8844,9 +8844,12 @@ def test_name_lookup_without_eval(self): self.assertIs(evaluate_forward_ref(typing.ForwardRef("int"), globals={"int": str}), str) import builtins - from test import support - with support.swap_attr(builtins, "int", dict): + real_int = builtins.int + try: + builtins.int = dict self.assertIs(evaluate_forward_ref(typing.ForwardRef("int")), dict) + finally: + builtins.int = real_int def test_nested_strings(self): # This variable must have a different name TypeVar