File: 0003-Use-benchmark-test-only-if-required-module-is-availa.patch

package info (click to toggle)
python-zeroconf 0.147.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,380 kB
  • sloc: python: 15,356; makefile: 23
file content (75 lines) | stat: -rw-r--r-- 2,542 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Date: Tue, 14 Jan 2025 12:53:06 +0900
Subject: Use benchmark test only if required module is available

CodSpeed is only available for amd64 and arm64.
---
 tests/benchmarks/test_cache.py          | 2 ++
 tests/benchmarks/test_incoming.py       | 2 ++
 tests/benchmarks/test_outgoing.py       | 2 ++
 tests/benchmarks/test_send.py           | 1 +
 tests/benchmarks/test_txt_properties.py | 2 ++
 5 files changed, 9 insertions(+)

diff --git a/tests/benchmarks/test_cache.py b/tests/benchmarks/test_cache.py
index 7813f67..8f50b45 100644
--- a/tests/benchmarks/test_cache.py
+++ b/tests/benchmarks/test_cache.py
@@ -1,5 +1,7 @@
 from __future__ import annotations
 
+import pytest
+pytest_codspeed = pytest.importorskip("pytest_codspeed")
 from pytest_codspeed import BenchmarkFixture
 
 from zeroconf import DNSCache, DNSPointer, current_time_millis
diff --git a/tests/benchmarks/test_incoming.py b/tests/benchmarks/test_incoming.py
index 6d31e51..e630f4f 100644
--- a/tests/benchmarks/test_incoming.py
+++ b/tests/benchmarks/test_incoming.py
@@ -4,6 +4,8 @@ from __future__ import annotations
 
 import socket
 
+import pytest
+pytest_codspeed = pytest.importorskip("pytest_codspeed")
 from pytest_codspeed import BenchmarkFixture
 
 from zeroconf import (
diff --git a/tests/benchmarks/test_outgoing.py b/tests/benchmarks/test_outgoing.py
index a8db4d6..4db56fb 100644
--- a/tests/benchmarks/test_outgoing.py
+++ b/tests/benchmarks/test_outgoing.py
@@ -2,6 +2,8 @@
 
 from __future__ import annotations
 
+import pytest
+pytest_codspeed = pytest.importorskip("pytest_codspeed")
 from pytest_codspeed import BenchmarkFixture
 
 from zeroconf._protocol.outgoing import State
diff --git a/tests/benchmarks/test_send.py b/tests/benchmarks/test_send.py
index 596662a..c1d9dea 100644
--- a/tests/benchmarks/test_send.py
+++ b/tests/benchmarks/test_send.py
@@ -3,6 +3,7 @@
 from __future__ import annotations
 
 import pytest
+pytest_codspeed = pytest.importorskip("pytest_codspeed")
 from pytest_codspeed import BenchmarkFixture
 
 from zeroconf.asyncio import AsyncZeroconf
diff --git a/tests/benchmarks/test_txt_properties.py b/tests/benchmarks/test_txt_properties.py
index 72afa0b..783ceba 100644
--- a/tests/benchmarks/test_txt_properties.py
+++ b/tests/benchmarks/test_txt_properties.py
@@ -1,5 +1,7 @@
 from __future__ import annotations
 
+import pytest
+pytest_codspeed = pytest.importorskip("pytest_codspeed")
 from pytest_codspeed import BenchmarkFixture
 
 from zeroconf import ServiceInfo