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

Fix occasional spurious test failures. #424

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ofrak_core/test_ofrak/components/test_comments.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from datetime import timedelta
import pytest
from hypothesis import given, HealthCheck, settings
from hypothesis.strategies import text
Expand Down Expand Up @@ -38,7 +39,10 @@ async def test_adding_comments(executable_resource: Resource):
# We suppress the function_scoped_fixture health check because the executable_resource fixture
# doesn't need to be reset between individual runs of hypothesis (since the comment overrides
# the previous one every time).
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
@settings(
suppress_health_check=[HealthCheck.function_scoped_fixture],
deadline=timedelta(seconds=5),
whyitfor marked this conversation as resolved.
Show resolved Hide resolved
)
@given(comment_str=text())
async def test_comment_content(executable_resource: Resource, comment_str: str):
"""Test comments with all kinds of string contents."""
Expand Down
3 changes: 3 additions & 0 deletions ofrak_core/test_ofrak/unit/test_ofrak_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ async def run_component_with_installed_dependency(ofrak_context: OFRAKContext):


def test_get_ofrak_context_over_time():
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

# No active context before running OFRAK
with pytest.raises(InvalidStateError):
get_current_ofrak_context()
Expand Down
Loading