-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Draft: refactor(python): rename unit.io
test dir to unit.read_write
to prevent conflation with builtin io
module
#7109
Conversation
…tion with builtin io module
We will need What are you doing that causes confusion with the builtin EDIT: Nevermind, just reproduced the issue (should read better). Hmm... |
It's especially noticeable if you're debugging from PyCharm, as the right-click "debug" (at module level or individual test level) sets itself up in such a way as to trigger the fatal error every single time, so you can only debug from the console...
Keeping the |
Actually now I can't reproduce this (had different errors)... could you give me the step-by-step for triggering this error? I would like our test structure to be able to mimic the main package structure, so I'm not a fan of this renaming. If I can reproduce the error, maybe I can find a different solution. |
Use PyCharm and try to debug the tests; you'll likely crash out with a fatal error :) |
Is there any console command I can run to trigger this? Not a PyCharm user myself. Not trying to be obnoxious here - but that will help me track down what the real issue is here. |
I suspect it comes down to where your relative working directory is, and the default test root associated with debugging in PyCharm is such that the I don't currently have a CLI/console version for replication; I only tracked it down the first time because I suddenly started getting weird errors when trying to debug (and then again when it came back this week) :( |
Ah; you might have trouble replicating because apparently I accidentally committed the removal of |
unit.io
test dir to unit.read_write
to prevent conflation with builtin io
moduleunit.io
test dir to unit.read_write
to prevent conflation with builtin io
module
I still can't get it to error, even with the Is this still an issue for you without an |
Nope; this completely fixes it as the directory no longer behaves like a module.
How about I add a simple unit test that checks if that |
Closed in favour of much lighter PR: #7116. |
The recent #6961 inadvertently reverted the #6889 fix (as these test directories aren't really packages/modules, they shouldn't have an
__init__
, or it can cause the error in the linked PR, reproduced below).So, we can do one of two things:
__init__
file in theunit.io
subdir again.unit.io
directory so it can't conflict with the builtin module.Since it's plausible that we may end up accidentally reintroducing
__init__
files in the future, I've opted for no.2, renaming this tests subdir fromio
toread_write
to prevent any unintended regressions later on.