bpo-40275: Add os_helper submodule in test.support#20732
bpo-40275: Add os_helper submodule in test.support#20732shihai1991 wants to merge 6 commits intopython:masterfrom
Conversation
|
@vstinner Hi, victor. Pls have a look again when you have free time. |
|
For the first PR (this one), please leave |
|
For example, os_helper.py would contain something like: |
Oh, My logic is the opposite. IMHO, it is same behavior, no? |
|
Brett and me explained to you that a PR modifying 100+ files is a bad idea. Adding a new submodule which only imports existing functions avoids modifying any existing test and so it becomes possible to convert tests slowly, one by one, or 20 by 20. |
Pls forgive me, I have relealized that it's not easy to review and noisy too many developers.
IMO: Oh, wait. You are right. Some testcase use inner functions of test.support will be affected. |
vstinner
left a comment
There was a problem hiding this comment.
move existing functions in new submodule and reimport those existing functions in test.support
Right. I tried to check if there are remaining functions in support/init.py which should be moved to os_helper. But since functions are not moved, it's not easy.
Would you mind to create a second PR which moves functions but adds aliases in support/init.py? It sounds like an even better approach.
|
|
||
| .. data:: SAVEDCWD | ||
|
|
||
| Set to :func:`os.getcwd`. |
There was a problem hiding this comment.
Side note: I'm not sure why it exists in test.support. It seems like only test.libregrtest uses it. Maybe it should be moved (later) to test.libregrtest.
There was a problem hiding this comment.
Hm, I checked this detail. Looks like the describe info is right. It points that SAVEDCWD=os.getcwd()
|
IMO PR #20765 is the right way to fix this issue. |
Import the following vars, functions, classes in os_helper:
https://bugs.python.org/issue40275