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

Set a less strict deadline for hypothesis tests #1682

Merged
merged 1 commit into from
Jun 7, 2023
Merged
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
9 changes: 8 additions & 1 deletion tests/flytekit/unit/core/test_type_conversion_errors.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Unit tests for type conversion errors."""

from datetime import timedelta
from string import ascii_lowercase
from typing import Tuple

import pytest
from hypothesis import given
from hypothesis import given, settings
from hypothesis import strategies as st

from flytekit import task, workflow
Expand Down Expand Up @@ -50,6 +51,7 @@ def wf_with_multioutput_error1(a: int, b: int) -> Tuple[str, int]:


@given(st.booleans() | st.integers() | st.text(ascii_lowercase))
@settings(deadline=timedelta(seconds=2))
def test_task_input_error(incorrect_input):
with pytest.raises(
TypeError,
Expand All @@ -62,6 +64,7 @@ def test_task_input_error(incorrect_input):


@given(st.floats())
@settings(deadline=timedelta(seconds=2))
def test_task_output_error(correct_input):
with pytest.raises(
TypeError,
Expand All @@ -74,6 +77,7 @@ def test_task_output_error(correct_input):


@given(st.integers())
@settings(deadline=timedelta(seconds=2))
def test_workflow_with_task_error(correct_input):
with pytest.raises(
TypeError,
Expand All @@ -88,6 +92,7 @@ def test_workflow_with_task_error(correct_input):


@given(st.booleans() | st.floats() | st.text(ascii_lowercase))
@settings(deadline=timedelta(seconds=2))
def test_workflow_with_input_error(incorrect_input):
with pytest.raises(
TypeError,
Expand All @@ -99,6 +104,7 @@ def test_workflow_with_input_error(incorrect_input):


@given(st.integers())
@settings(deadline=timedelta(seconds=2))
def test_workflow_with_output_error(correct_input):
with pytest.raises(
TypeError,
Expand All @@ -118,6 +124,7 @@ def test_workflow_with_output_error(correct_input):
],
)
@given(st.integers())
@settings(deadline=timedelta(seconds=2))
def test_workflow_with_multioutput_error(workflow, position, correct_input):
with pytest.raises(
TypeError,
Expand Down