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

AssertionError when using hypothesis with threading #337

Closed
Ezibenroc opened this issue Jun 22, 2016 · 4 comments
Closed

AssertionError when using hypothesis with threading #337

Ezibenroc opened this issue Jun 22, 2016 · 4 comments

Comments

@Ezibenroc
Copy link

I would like to use hypothesis with threading module.
The following code raises an AssertionError:

import hypothesis
import hypothesis.strategies as st
import threading

@hypothesis.given(st.integers())
def test(n):
    pass

t = threading.Thread(target = test)
t.start()
t.join()

Am I missing something? How can I run a function which uses hypothesis in a thread?

@pajowu
Copy link

pajowu commented Jun 22, 2016

Looks like, _settings.py line 94 should't reassign default_variable.value.
settings.load_profile never returns anything, so code could be simplyfied down to

def load_profile():
    pass
value = load_profile()
assert value is not None

I really hope I didn't miss any side-effects here

@DRMacIver
Copy link
Member

Huh. Sorry about that. Victim of the fact that due to reasons the settings module is excluded from my 100% coverage requirements I guess. :-(

I'm travelling at the moment and what free time I have is quite occupied, so I'll probably not get a chance to look at this soon. I'd happily accept and review a pull request (it's easier to do that from a phone!) but if not I'll try to get to fixing this in the next week or two.

DRMacIver added a commit that referenced this issue Jul 13, 2016
@Zac-HD
Copy link
Member

Zac-HD commented Mar 30, 2017

Closed by 1bcbc4e?

@Ezibenroc
Copy link
Author

@Zac-HD Wow, this commit is quite old, I did not notice it.
I tested again. The problem seems to be fixed indeed.

I am closing the issue, thanks for your help.

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

No branches or pull requests

4 participants