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

Directly use ConjectureData.draw_boolean() in booleans() #3873

Merged
merged 3 commits into from
Feb 5, 2024

Conversation

tybug
Copy link
Member

@tybug tybug commented Feb 5, 2024

I don't think this has a meaningful impact yet, but directly interfacing with the IR will provide benefits in the future (e.g. better/faster shrinking). Also shamelessly snuck in a comment about the IR, since I missed doing it before we merged #3818.

A general question: is there a difference between @defines_strategy(force_reusable_values=True) and stating so at the strategy level?

class BooleansStrategy(SearchStrategy):
    ...
    def calc_has_reusable_values(self, recur):
        return True

Both seemed to work; I used the former here in order to match existing strategies, even though the latter seems more explicit.

@tybug tybug requested a review from Zac-HD as a code owner February 5, 2024 05:25
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.

Hopefully we can make the equivalent integers() and sampled_from() strategies just as efficient! No objection to this though 🙂

@Zac-HD Zac-HD merged commit 156a8be into HypothesisWorks:master Feb 5, 2024
48 checks passed
@tybug tybug deleted the booleans-use-ir branch February 5, 2024 19:54
@Zac-HD
Copy link
Member

Zac-HD commented Feb 5, 2024

I'm seeing a pretty consistent failure on win-10: four retries so far for https://github.com/HypothesisWorks/hypothesis/actions/runs/7780760113/job/21220202164

I think what's happening here is that we're getting an error from our patch-dumping code, which looks like it might be due to incomplete initialization in black??? Probably the next step is to get the source code string we're trying to format, and see if that reproduces the problem locally...

@jobh
Copy link
Contributor

jobh commented Feb 6, 2024

I'm seeing a pretty consistent failure on win-10: four retries so far for

It went away? Otherwise, discarding the installed deps cache entry might be worth a try, to rule it out if nothing else.

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.

None yet

3 participants