This is an automated email from the ASF dual-hosted git repository.

sadpandajoe pushed a commit to branch ultraset-mh-pyfakefs-py313-2
in repository https://gitbox.apache.org/repos/asf/superset.git

commit d1ee77accf61600b3470c9d7039402a09c0b3329
Author: Joe Li <[email protected]>
AuthorDate: Thu Oct 1 01:49:03 2026 +0000

    fix(ci): floor pyfakefs at 5.7.4 to fix Python 3.13 pytest-cov crash
    
    pyfakefs was an unpinned direct dependency of the `development` extra, so
    requirements/development.txt had it locked at 5.3.5 -- a release that
    predates pyfakefs's own Python 3.13 support. Under 3.13, 5.3.5 leaves
    os.chdir patched to the fake filesystem after the function-scoped `fs`
    fixture is undone, so when pytest-cov's pytest_runtestloop hookwrapper
    teardown chdirs back to the rootdir it raises
    FileNotFoundError/KeyError/OSError against the fake filesystem and aborts
    the whole session with a PluggyTeardownRaisedWarning + INTERNALERROR.
    
    This broke the Python-Integration workflow's `test-postgres (next)` job
    (Python 3.13) once PR #44767 moved that leg off 3.12 -- the abort lands
    right after tests/integration_tests/celery_tests.py, as pytest reaches
    cli_tests.py, the only test file using pyfakefs's `fs` fixture.
    
    The floor is 5.7.4 rather than 5.6.0 (preliminary 3.13 support, the first
    release in which the chdir crash no longer reproduces) or 5.7.0 (official
    3.13 support) because 5.7.4 additionally fixes module/session-scoped
    fixtures under 3.13 (pyfakefs #1101), and the `fs` tests in cli_tests.py
    run alongside session- and module-scoped fixtures. 6.x drops Python < 3.10,
    which is compatible with this project's `requires-python = ">=3.11"`, and
    adds no new runtime dependencies, so the lock change is a single line.
    
    Verified with an isolated pytest + pytest-cov + pyfakefs repro using CI's
    pinned versions (pytest 7.4.4, pytest-cov 6.0.0, coverage 7.6.8): on
    Python 3.13.15 the identical INTERNALERROR signature reproduces with
    pyfakefs 5.3.5 and 5.4.1/5.5.0, and is GREEN from 5.6.0 onward including
    the resolved 6.2.0; GREEN on 3.11.16 and 3.12.14 as well.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
---
 pyproject.toml               | 12 +++++++++++-
 requirements/development.txt |  2 +-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index 2ee94c6ed3b..b617e14492d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -319,7 +319,17 @@ development = [
     "pre-commit",
     "progress>=1.6.1,<2",
     "psutil",
-    "pyfakefs",
+    # 5.3.5 (the previously resolved version) predates pyfakefs's own Python
+    # 3.13 support: under 3.13 it leaves os.chdir patched to the fake
+    # filesystem after the `fs` fixture is undone, so the chdir back to the
+    # rootdir in pytest-cov's own teardown aborts the whole session with an
+    # INTERNALERROR. 5.6.0 added preliminary 3.13 support, which is what stops
+    # that crash, and 5.7.0 made 3.13 support official. 5.7.4 is the floor
+    # rather than 5.7.0 because it also fixes module/session-scoped fixtures
+    # under 3.13 (pyfakefs #1101), and the `fs` tests in
+    # tests/integration_tests/cli_tests.py -- the only consumers of that
+    # fixture -- run alongside session- and module-scoped fixtures.
+    "pyfakefs>=5.7.4",
     "pyinstrument>=5.1.3,<6",
     "pylint",
     "pytest<10.0.0", # cap below the next major until validated; the earlier 
<8 pin (current_app proxy timing) no longer reproduces
diff --git a/requirements/development.txt b/requirements/development.txt
index 0a78383ba8f..7d00db2a7ae 100644
--- a/requirements/development.txt
+++ b/requirements/development.txt
@@ -824,7 +824,7 @@ pydata-google-auth==1.9.0
     # via pandas-gbq
 pydruid==0.6.9
     # via apache-superset
-pyfakefs==5.3.5
+pyfakefs==6.2.0
     # via apache-superset
 pygeohash==3.2.2
     # via

Reply via email to