Title: test_modulefinder always modifies execution environment · Issue #93616 · python/cpython · GitHub
Open Graph Title: test_modulefinder always modifies execution environment · Issue #93616 · python/cpython
X Title: test_modulefinder always modifies execution environment · Issue #93616 · python/cpython
Description: Bug report test_modulefinder creates a temporary directory in its global module scope cpython/Lib/test/test_modulefinder.py Lines 13 to 14 in 22df2e0 TEST_DIR = tempfile.mkdtemp() TEST_PATH = [TEST_DIR, os.path.dirname(tempfile.__file__)...
Open Graph Description: Bug report test_modulefinder creates a temporary directory in its global module scope cpython/Lib/test/test_modulefinder.py Lines 13 to 14 in 22df2e0 TEST_DIR = tempfile.mkdtemp() TEST_PATH = [TEST...
X Description: Bug report test_modulefinder creates a temporary directory in its global module scope cpython/Lib/test/test_modulefinder.py Lines 13 to 14 in 22df2e0 TEST_DIR = tempfile.mkdtemp() TEST_PATH = [TEST...
Opengraph URL: https://github.com/python/cpython/issues/93616
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_modulefinder always modifies execution environment","articleBody":"**Bug report**\r\n\r\n``test_modulefinder`` creates a temporary directory in its global module scope\r\n\r\nhttps://github.com/python/cpython/blob/22df2e0322300d25c1255ceb73cacc0ebd96b20e/Lib/test/test_modulefinder.py#L13-L14\r\n\r\nand removes the temporary directory in each test method\r\n\r\nhttps://github.com/python/cpython/blob/22df2e0322300d25c1255ceb73cacc0ebd96b20e/Lib/test/test_modulefinder.py#L349-L350\r\n\r\nIf 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:\r\n\r\n```\r\n/python-wasm/cpython/builddir/wasi# wasmtime run --mapdir .::../../ -- python.wasm -m test --fail-env-changed test_modulefinder\r\n0:00:00 Run tests sequentially\r\n0:00:00 [1/1] test_modulefinder\r\nWarning -- files was modified by test_modulefinder\r\nWarning -- Before: ['tmp8avdrxn0/']\r\nWarning -- After: [] \r\ntest_modulefinder failed (env changed)\r\n\r\n== Tests result: ENV CHANGED ==\r\n\r\n1 test altered the execution environment:\r\n test_modulefinder\r\n\r\nTotal duration: 292 ms\r\nTests result: ENV CHANGED\r\n```\r\n\r\n``test_modulefinder`` should create the temporary directory in setUp and rmtree it in tearDown methods instead.","author":{"url":"https://github.com/tiran","@type":"Person","name":"tiran"},"datePublished":"2022-06-08T20:30:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/93616/cpython/issues/93616"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1ec41fe4-82a4-7227-d21e-850c05e692d8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B0F2:65407:389B43:4B9F1D:6969AD38 |
| html-safe-nonce | 4e056c754fa2d113c5232388c03797f6eac3d0e1f2c98cf0f5e55bc6bd430c79 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEYyOjY1NDA3OjM4OUI0Mzo0QjlGMUQ6Njk2OUFEMzgiLCJ2aXNpdG9yX2lkIjoiMjA3MDk2MTUzMTcxNTY5Mzg4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | aecdace033bd226c4d28b8624d9b481507ffeb0b2a06f8240a4aeeff84c4b0e6 |
| hovercard-subject-tag | issue:1265269089 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/93616/issue_layout |
| twitter:image | https://opengraph.githubassets.com/398da417f4e164b81630c7efc9fd9022c768fa63b2bf3bb62f671100ce82084d/python/cpython/issues/93616 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/398da417f4e164b81630c7efc9fd9022c768fa63b2bf3bb62f671100ce82084d/python/cpython/issues/93616 |
| og:image:alt | Bug report test_modulefinder creates a temporary directory in its global module scope cpython/Lib/test/test_modulefinder.py Lines 13 to 14 in 22df2e0 TEST_DIR = tempfile.mkdtemp() TEST_PATH = [TEST... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tiran |
| hostname | github.com |
| expected-hostname | github.com |
| None | 24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 124667f43168afb6c9c03b7c02eb5b1d2e1be3d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width