-
Notifications
You must be signed in to change notification settings - Fork 51
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
PurePath(LazyIntSymbolicStr)
error
#280
Comments
Hmm, I see a lot of failures that this could explain actually 🤔 |
Oh wow this makes me so happy. And at the risk of embarrassing myself, I'll give you a needlessly detailed response:
|
I really appreciate you taking the time to write this up <3. The c conversion makes sense as a critical juncture. I admit my diagnosis of 'some symbolic strings work fine' was a conclusion based on the following passing: from pathlib import PurePath
def f(s: str) -> None:
'''
post: True
'''
PurePath(s) |
Oooooh! Ok, so I'd totally forgotten about this, and it's really great that you brought it up. There is a hacky part of regular CrossHair that checks TypeErrors on their way out and looks for a few CrossHair type names in the exception message. If it finds a CrossHair type name, it suppresses the error and ignores that path. This code is tucked away in a corner that I simply hadn't thought to include in the hypothesis plugin. Part of me doesn't want to copy that logic over to the plugin because it's been so great for issue discovery. However, it probably needs to stick around because we'll never support arbitrary 3rd party C modules. Plus, it'll fix a lot of hypothesis tests, and I can always disable the feature locally to go bug hunting at my leisure. So, I think I'll proceed with propagating my hack, unless someone has a counterpoint. Filed pschanely/hypothesis-crosshair#19 |
Hypothesis' |
And ... support for os.fspath on symbolic strings has landed in v0.0.64. |
https://crosshair-web.org/?crosshair=0.1&python=3.8&gist=35e9e3726667c18ebffe94d2e88007de, in triaging
test_can_generate_from_all_registered_types[PathLike]
from HypothesisWorks/hypothesis#4034.This one is my largest reach yet in correctly setting up the prereqs. This doesn't happen for "normal" symbolic strings, only
LazyIntSymbolicStr
. If I was to backseat and potentially embarrass myself, I would guessLazyIntSymbolicStr
needs to declare_pytype
asstr
?The text was updated successfully, but these errors were encountered: