Uh oh!
There was an error while loading. Please reload this page.
Update fine-grained tests to prep for --namespace-packages support - #11259
Conversation
hauntsaninja
left a comment
There was a problem hiding this comment.
Thanks! Got pretty thrown off by Import of "p.a" ignored. I just didn't realise that finegrained tests set follow_imports = error by default. Feels like there's a shortage of follow_imports=normal tests too...
hauntsaninja
left a comment
There was a problem hiding this comment.
Actually, maybe it's more in the spirit of the testDeletePackage5 and testDeletePackage6 to change the commands, since they are trying to pass p.a on the command line. E.g., maybe we pass --explicit-package-bases or switch to specifying -m instead of files.
nipunn1313
commented
Oct 4, 2021
We still need to provide I can change them to use |
hauntsaninja
commented
Oct 4, 2021
Yes, agreed on passing since when the command is e.g. To that end, I was suggesting something like: with the hope of changing that middle error message. It looks to me like even with that change we still ignore I might be missing something obvious though :-) |
nipunn1313
commented
Oct 4, 2021
I see your point! With namespace packages, |
hauntsaninja
commented
Oct 5, 2021
Okay, so this is the diff I'm playing around with now. That is, I think at least some of the problem is that the test fixtures were passing in Unfortunately, mypy now silently passes once we delete |
nipunn1313
commented
Oct 12, 2021
Ok - so I confirmed that there's a bug in mypy daemon when using Repro steps: Initial conditions:
We expect Note that if the initial conditions are Then it is handled! It has to do with the update logic in mypy daemon. I spent several hours trying to understand update.py and fix this bug and really struggled. |
These tests were deleting package files, but not the empty directory, causing those directories to be interpreted as namespace packages in python#9636
| main:2: error: Cannot find implementation or library stub for module named "p" | ||
| [case testDeletePackage4] | ||
| # flags: --no-namespace-packages |
There was a problem hiding this comment.
I filed #11322 to convert these in the future.
nipunn1313
commented
Oct 12, 2021
nipunn1313
commented
Oct 28, 2021
Hiya friends (@hauntsaninja)! Wanted to bump this one. |
nipunn1313
commented
Nov 17, 2021
Hiya again! (@hauntsaninja)! Wanted to bump this one. |
hauntsaninja
left a comment
There was a problem hiding this comment.
Thanks, I think I left this dangling in the hope that I could quickly fix #11322. Clearly that hasn't happened in the last month, so merge it is :-) Thanks for pushing on this!
hauntsaninja
commented
Nov 17, 2021
Also merged master into #9636 |
These tests were deleting package files, but not the empty
directory, causing those directories to be interpreted as
namespace packages in #9636
Test Plan
Tried these out on top of #9636 and confirmed they all work. A couple changed error messages - so I needed to add flags for
--namespace-packages, but figured that's the future anyway, so this is a good thing.