Skip to content
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

Migrate explain phase to the typed choice sequence #4162

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

tybug
Copy link
Member

@tybug tybug commented Nov 9, 2024

Closes #3864. Take two of #4160 due to git weirdness.

@tybug tybug requested a review from Zac-HD as a code owner November 9, 2024 16:44
@tybug
Copy link
Member Author

tybug commented Nov 9, 2024

hmm, not sure if this failure is related yet

FAILED whole_repo_tests/test_mypy.py::test_stateful_bundle_generic_type - AssertionError: 
assert 0 == 1
 +  where 0 = len([])
 +    where [] = <built-in method splitlines of str object at 0x7f80b1108030>()
 +      where <built-in method splitlines of str object at 0x7f80b1108030> = ''.splitlines

@Zac-HD
Copy link
Member

Zac-HD commented Nov 9, 2024

I think I've seen that flake before; probably we should just add a few retries in case the command returns empty string?

I also noticed that it looks like a subsequent mypy upgrade has this test passing, so we can remove the xfail 🙂

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woohoo!

Comment on lines +1531 to +1540
# a draw_bits call which straddles the end of our prefix has a slightly
# different code branch.
def test(data):
# float consumes draw_bits(64)
data.draw_float()

with deterministic_PRNG():
runner = ConjectureRunner(test, settings=TEST_SETTINGS)
d = runner.cached_test_function(bytes(10), extend=100)
assert d.status == Status.VALID
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drawing one float uses <10 bytes, I think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more - a bunch for the sampler, 1 for the sign, and 8 for the value. I only added this test because the branch mentioned in the comments was uncovered, so I'm pretty confident this test does indeed execute that branch.

@Zac-HD Zac-HD merged commit d8c3522 into HypothesisWorks:master Nov 9, 2024
48 checks passed
@tybug tybug deleted the explain-ir-actual branch November 9, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inquisitor sometimes fails to report arguments as freely varying
2 participants