-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-47089: Avoid test_compileall failures on Windows #32037
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
Conversation
Lib/test/test_compileall.py
Outdated
if not self._sys_path_writable: | ||
raise unittest.SkipTest('not all entries on sys.path are writable') | ||
@contextlib.contextmanager | ||
def _use_pycache_prefix(self, basedir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to a different name and omit the parameter which is always self.directory:
def _use_pycache_prefix(self, basedir): | |
def set_pycache_prefix(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was attempting to match the "style" of this file as best as possible. I have now renamed it to match the context manager used within test_importlib. Also, "set" doesn't feel right for use in a with statement. I guess it comes from English grammar of using present participle (-ing forms) after prepositions (with
).
@@ -460,31 +460,18 @@ def test_error(self): | |||
class CommandLineTestsBase: | |||
"""Test compileall's CLI.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I reviewed this PR, I failed to find where self.directory
comes from. Usually, the setUp() method is defined first in a test case. Would you move to move the setUp() of this class at the beginning? It would help to see where self.directory comes from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. The test suite as a whole is pretty much a free-for-all style-wise.
Sorry, @jkloth and @vstinner, I could not cleanly backport this to |
GH-32237 is a backport of this pull request to the 3.10 branch. |
(cherry picked from commit 76b8a07) Co-authored-by: Jeremy Kloth <jeremy.kloth@gmail.com>
Merged, thanks! @jkloth: There are conflicts on backporting your fix to 3.9. Do you want to attempt backporting it manually? |
GH-32240 is a backport of this pull request to the 3.9 branch. |
…32037). (pythonGH-32240) * [3.9] bpo-47089: Avoid test_compileall failures on Windows (pythonGH-32037). (cherry picked from commit 76b8a07) Co-authored-by: Jeremy Kloth <jeremy.kloth@gmail.com>
https://bugs.python.org/issue47089