-
Notifications
You must be signed in to change notification settings - Fork 595
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
Test failures with test_not_literal_with_ignorecase #878
Comments
It is a flaky test, but it's one that I think is exposing a real problem rather than a harmless one. If you run it with the seed in the output I assume it reproduces? |
No, it doesn't. I run them in a clean build environment each time, not sure if that makes a difference. |
Just to check, is this true if you pass the seed with the pytest argument? because of the way we're running the tests ourselves (which is a bit nonstandard) adding a |
No, that's how I pass the seed. The full command:
|
Wait, what? How does that work? Do you have some customisations to the setup.py? Because pytest definitely isn't a recognised command in our setup.py |
That's a command added by |
Knowing this example was hiding in the weeds somewhere, I ran the following test: import re
from hypothesis import given
from hypothesis.strategies import from_regex
@given(from_regex(re.compile(u'[^a][^b]', re.IGNORECASE)))
def test_x_is_not_integer(s):
assert s != u'A00' (I know equality tests are quite hard to hit, but I knew this example was possible.) Eventually, it found this example, and I got the following repro which seems to work on my machine (specifically, my work laptop – macOS 10.12.4, Python 3.6.1, Hypothesis at 770e394). import re
from hypothesis import seed, given
from hypothesis.strategies import from_regex
@seed(298794930177074211994066318099942485621)
@given(from_regex(re.compile(u'[^a][^b]', re.IGNORECASE)))
def test_x_is_not_integer(s):
assert s[0] not in (u'a', u'A') and s[1] not in (u'b', u'B') Are seeds portable across machines? If so, that example should repro elsewhere. If not, the same technique is probably usable for getting a repro on another machine. (Yes, the function name sucks, I was editing an old testing file I had around. Changing the function name seems to invalidate the seed, so I’m leaving it for now!) |
I know very little about the internals of the regex strategy (and I have to go back to my actual job), but in case it’s helpful, this is the coverage report when I run that script locally: https://gist.github.com/alexwlchan/8ca2bd68f1c598eab05a382f40066e7e The missing lines might give a clue as to where regex.py is going. Let me know if there’s other stuff I can do to help, but I don’t think I can debug this one myself. |
Hypothesis 3.30.0, Python 2.7.13, Pytest 3.2.2, Arch Linux x86_64.
A simple retry made it passing, so I guess it's another case of flaky test.
The text was updated successfully, but these errors were encountered: