Title: Bug in `regrtest` when name in `SPLITTESTDIRS` also matches a module name in tests · Issue #109402 · python/cpython · GitHub
Open Graph Title: Bug in `regrtest` when name in `SPLITTESTDIRS` also matches a module name in tests · Issue #109402 · python/cpython
X Title: Bug in `regrtest` when name in `SPLITTESTDIRS` also matches a module name in tests · Issue #109402 · python/cpython
Description: Bug report During #109368 I tried to create Lib/test/test_future/ directory. It did not go well: » ./python.exe -m test test_future Traceback (most recent call last): File "/Users/sobolev/Desktop/cpython/Lib/runpy.py", line 198, in _run_...
Open Graph Description: Bug report During #109368 I tried to create Lib/test/test_future/ directory. It did not go well: » ./python.exe -m test test_future Traceback (most recent call last): File "/Users/sobolev/Desktop/c...
X Description: Bug report During #109368 I tried to create Lib/test/test_future/ directory. It did not go well: » ./python.exe -m test test_future Traceback (most recent call last): File "/Users/sobolev/Desk...
Opengraph URL: https://github.com/python/cpython/issues/109402
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug in `regrtest` when name in `SPLITTESTDIRS` also matches a module name in tests","articleBody":"# Bug report\n\nDuring https://github.com/python/cpython/pull/109368 I tried to create `Lib/test/test_future/` directory. It did not go well:\n\n```\n» ./python.exe -m test test_future\nTraceback (most recent call last):\n File \"/Users/sobolev/Desktop/cpython/Lib/runpy.py\", line 198, in _run_module_as_main\n return _run_code(code, main_globals, None,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/sobolev/Desktop/cpython/Lib/runpy.py\", line 88, in _run_code\n exec(code, run_globals)\n File \"/Users/sobolev/Desktop/cpython/Lib/test/__main__.py\", line 2, in \u003cmodule\u003e\n main()\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py\", line 511, in main\n Regrtest(ns).main(tests=tests)\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py\", line 492, in main\n selected, tests = self.find_tests(tests)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py\", line 176, in find_tests\n alltests = findtests(testdir=self.test_dir,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/findtests.py\", line 45, in findtests\n tests.extend(findtests(testdir=subdir, exclude=exclude,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/findtests.py\", line 45, in findtests\n tests.extend(findtests(testdir=subdir, exclude=exclude,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/findtests.py\", line 38, in findtests\n for name in os.listdir(testdir):\n ^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: '/Users/sobolev/Desktop/cpython/Lib/test/test_future/test_future'\n```\n\nI renamed `Lib/test/test_future/test_future.py` to `Lib/test/test_future/test_import_future.py`\nNow I get a new error (but similar):\n\n```\n» ./python.exe -m test test_future\nTraceback (most recent call last):\n File \"/Users/sobolev/Desktop/cpython/Lib/runpy.py\", line 198, in _run_module_as_main\n return _run_code(code, main_globals, None,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/sobolev/Desktop/cpython/Lib/runpy.py\", line 88, in _run_code\n exec(code, run_globals)\n File \"/Users/sobolev/Desktop/cpython/Lib/test/__main__.py\", line 2, in \u003cmodule\u003e\n main()\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py\", line 511, in main\n Regrtest(ns).main(tests=tests)\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py\", line 492, in main\n selected, tests = self.find_tests(tests)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py\", line 176, in find_tests\n alltests = findtests(testdir=self.test_dir,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/findtests.py\", line 45, in findtests\n tests.extend(findtests(testdir=subdir, exclude=exclude,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/findtests.py\", line 45, in findtests\n tests.extend(findtests(testdir=subdir, exclude=exclude,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/findtests.py\", line 38, in findtests\n for name in os.listdir(testdir):\n ^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: '/Users/sobolev/Desktop/cpython/Lib/test/test_concurrent_futures/test_future'\n```\n\nThis looks like a bug to me.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-109403\n* gh-109404\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2023-09-14T12:44:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/109402/cpython/issues/109402"}
| 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:753a89cc-2b0b-86f7-7cb9-ed92ae04b6fe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C5BC:27B1FA:BCC227:F86169:696B59E4 |
| html-safe-nonce | e3a5cc28b280be6ac05e2bdac929e79282635080a87987bf56298ab27a6befc2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUJDOjI3QjFGQTpCQ0MyMjc6Rjg2MTY5OjY5NkI1OUU0IiwidmlzaXRvcl9pZCI6Ijg1MjEwNzI3MzAyNzY4NDYwNTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0ea198827874150daeeae050603ebddfbca9a371632232e0cc1d947ebf06abb9 |
| hovercard-subject-tag | issue:1896500279 |
| 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/109402/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6c0397db345f1bfd8446ef1c81ec1eae6fd9f2986c4909af84c07a1c6203f250/python/cpython/issues/109402 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6c0397db345f1bfd8446ef1c81ec1eae6fd9f2986c4909af84c07a1c6203f250/python/cpython/issues/109402 |
| og:image:alt | Bug report During #109368 I tried to create Lib/test/test_future/ directory. It did not go well: » ./python.exe -m test test_future Traceback (most recent call last): File "/Users/sobolev/Desktop/c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sobolevn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width