Skip to content

Commit 00c09a4

Browse files
committed
fix(tests): Add Pytest timeout mark.
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
1 parent a9c1ea7 commit 00c09a4

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[pytest]
2+
timeout = 60
23
log_cli = 1
34
log_cli_level = WARN
45
log_cli_format = %(asctime)s %(levelname)s %(message)s
@@ -10,3 +11,4 @@ testpaths =
1011
tests_autowrapt
1112
markers =
1213
original: mark test to use the original method instead of the mocked ones under `conftest.py`
14+

tests/clients/test_google-cloud-pubsub.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
os.environ["PUBSUB_EMULATOR_HOST"] = "localhost:8681"
2222

2323

24+
@pytest.mark.timeout(30)
2425
class TestPubSubPublish(_TraceContextMixin):
2526
publisher = PublisherClient()
2627

@@ -111,6 +112,7 @@ def __call__(self, message) -> None:
111112
self.calls += 1
112113

113114

115+
@pytest.mark.timeout(30)
114116
class TestPubSubSubscribe(_TraceContextMixin):
115117
@classmethod
116118
def setup_class(cls) -> None:

tests/requirements-minimal.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
coverage>=5.5
22
pytest>=4.6
3+
pytest-timeout>=2.4.0

0 commit comments

Comments
 (0)