New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor the test_runpy walk_package support code into a common location #59581
Comments
This issue is to refactor the create-package code in test_runpy into a helper module, as suggested in bpo-15358. This is a prerequisite to moving the pkgutil.walk_package() tests from test_runpy into test_pkgutil. |
One trap to watch out for: it's best to call os.path.realpath() on any temporary directories created, since the interpreter tends to do that internally. I'd previously dealt with this in script_helper.temp_dir, but it came up again when I tightened up the runpy.run_module tests to actually check that __file__ ended up with the expected value. |
I'm going to address this issue in parts to make it easier to review and see what is going on. The first patch I'm uploading shortly here: bpo-15403. That issue I created to address just the "file creation" part of the code. The approach I'm taking is to keep the file creation code decoupled from the temp directory, sys.path, and import code. My plan is to address the latter in separate patches by creating or modifying existing test support context managers, as necessary. |
I created bpo-15415 and uploaded a patch there with this issue in mind. test_runpy contains supporting _make_pkg() and _del_pkg() methods that, The patch uploaded to bpo-15415 creates such a context manager and |
test.support is now a subpackage in both 3.3 and default, but test.support.package_helper still needs to be created (see comments on bpo-15403) |
@breamoreboy, it looks like the next step would be to revisit bpo-15403 and go through the steps outlined by @ncoghlan. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: