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: Replace flaky with pytest.mark.flaky #1301

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 1 addition & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@
]
UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
UNIT_TEST_DEPENDENCIES: List[str] = [
"flaky",
]
UNIT_TEST_DEPENDENCIES: List[str] = []
UNIT_TEST_EXTRAS: List[str] = []
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}

Expand Down
1 change: 0 additions & 1 deletion owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@
cov_level=100,
versions=gcp.common.detect_versions(path="./google", default_first=True),
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"],
unit_test_dependencies=["flaky"],
system_test_python_versions=["3.12"],
system_test_external_dependencies=["psutil","flaky"],
)
Expand Down
8 changes: 1 addition & 7 deletions tests/unit/pubsub_v1/publisher/test_publisher_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

import pytest
import time
from flaky import flaky
from typing import cast, Callable, Any, TypeVar

from opentelemetry import trace
from google.api_core import gapic_v1
Expand All @@ -51,10 +49,6 @@
)


C = TypeVar("C", bound=Callable[..., Any])
typed_flaky = cast(Callable[[C], C], flaky(max_runs=5, min_passes=1))


def _assert_retries_equal(retry, retry2):
# Retry instances cannot be directly compared, because their predicates are
# different instances of the same function. We thus manually compare their other
Expand Down Expand Up @@ -148,7 +142,7 @@ def test_init_w_custom_transport(creds):
False,
],
)
@typed_flaky
@pytest.mark.flaky(retries=5)
def test_open_telemetry_publisher_options(creds, enable_open_telemetry):
if sys.version_info >= (3, 8) or enable_open_telemetry is False:
client = publisher.Client(
Expand Down
Loading