Skip to content

Commit c25df13

Browse files
authored
🔧 benchmark group non win32 (#1450)
The memray dependency is only available for linux and macos.
1 parent 500a448 commit c25df13

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

‎pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ test = [
5050
"pytest-xprocess~=1.0",
5151
]
5252
test-parallel = ["pytest-xdist"]
53-
benchmark = ["pytest-benchmark~=5.0", "memray>=1.3.1,<2.0.0"]
53+
benchmark = [
54+
"pytest-benchmark~=5.0; sys_platform != 'win32'",
55+
"memray>=1.3.1,<2.0.0; sys_platform != 'win32'",
56+
]
5457
docs = [
5558
"matplotlib>=3.3.0",
5659
"sphinxcontrib-plantuml~=0.0",

‎tests/benchmarks/test_official.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import contextlib
12
import json
23
import re
4+
import sys
35
import uuid
46
from pathlib import Path
57
from random import randrange
68

7-
import memray
89
import pytest
910
import responses
1011

@@ -15,6 +16,10 @@
1516
GITHUB_SPECIFIC_ISSUE_ANSWER,
1617
)
1718

19+
with contextlib.suppress(ImportError):
20+
# not available for Windows
21+
import memray
22+
1823

1924
def random_data_callback(request):
2025
"""
@@ -70,6 +75,9 @@ def test_official_time(test_app, benchmark):
7075
[{"buildername": "html", "srcdir": "../docs", "parallel": 1}],
7176
indirect=True,
7277
)
78+
@pytest.mark.skipif(
79+
sys.platform.startswith("win"), reason="memray not available on Windows"
80+
)
7381
def test_official_memory(test_app):
7482
responses.add_callback(
7583
responses.GET,

0 commit comments

Comments
 (0)