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

Unflake hypothesis tests #333

Merged
merged 1 commit into from
Feb 4, 2021
Merged

Unflake hypothesis tests #333

merged 1 commit into from
Feb 4, 2021

Conversation

pckroon
Copy link
Member

@pckroon pckroon commented Jan 28, 2021

Restrict hypothesis strategies generating interaction types and molecule names from using characters in the unicode classes Z (separators) and C (control characters).
This should resolve some intermittent test failures, for example the one in #328

@pckroon pckroon requested review from fgrunewald and jbarnoud and removed request for fgrunewald February 2, 2021 10:16
jbarnoud
jbarnoud previously approved these changes Feb 3, 2021
vermouth/tests/molecule_strategies.py Outdated Show resolved Hide resolved
@hypothesis.given(
moltype=st.one_of(
st.none(),
st.text(st.characters(blacklist_categories=('C', 'Z')), min_size=1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe an example case with a character from class C and Z just to know how things explode or not? I would not fight for it, though. If you are using a bell character as an atom name you are looking for problems and you deserve them.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had false test failures (because of how I test molecule.__str__) where an interaction type is named "0 a" with 0 interactions, which is in "0 atoms", resulting in test failure. It doesn't blow up perse.
Or a molecule name matching an empty interaction type, something along those lines.

Easier to sanitize the input a bit than figure out and asssume out all possible false failure modes.

Restrict hypothesis strategies generating interaction types and molecule names from using characters in the unicode classes Z (separators) and C (control characters).
@pckroon pckroon merged commit 5117211 into master Feb 4, 2021
@pckroon pckroon deleted the unflake branch February 4, 2021 10:13
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.

2 participants