Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test_modulefinder always modifies execution environment #93616

Closed
Labels
3.11only security fixes3.12only security fixestype-bugAn unexpected behavior, bug, or error
@tiran

Description

@tiran

Bug report

test_modulefinder creates a temporary directory in its global module scope

TEST_DIR=tempfile.mkdtemp()
TEST_PATH= [TEST_DIR,os.path.dirname(tempfile.__file__)]

and removes the temporary directory in each test method

finally:
shutil.rmtree(TEST_DIR)

If the test is executed in an environment without test worker processes (e.g. WASI) then the test runner complains about changes to the execution environment:

/python-wasm/cpython/builddir/wasi# wasmtime run --mapdir .::../../ -- python.wasm -m test --fail-env-changed test_modulefinder0:00:00 Run tests sequentially0:00:00 [1/1] test_modulefinderWarning -- files was modified by test_modulefinderWarning --   Before: ['tmp8avdrxn0/']Warning --   After:  [] test_modulefinder failed (env changed)== Tests result: ENV CHANGED ==1 test altered the execution environment:    test_modulefinderTotal duration: 292 msTests result: ENV CHANGED

test_modulefinder should create the temporary directory in setUp and rmtree it in tearDown methods instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp