Skip to content

Commit

Permalink
try using pytest-speed as a substitute for pytest-benchmark for wasm …
Browse files Browse the repository at this point in the history
…builds
  • Loading branch information
samuelcolvin committed Jul 5, 2022
1 parent 158ab9a commit e7988d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
21 changes: 0 additions & 21 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import importlib.util
import json
import os
import sys
from dataclasses import dataclass
from pathlib import Path
from typing import Any
Expand Down Expand Up @@ -89,23 +88,3 @@ def _import_execute(source: str, *, custom_module_name: str = None):
print('KeyboardInterrupt')

return _import_execute


if sys.platform == 'emscripten':
# we have to stub pytest-benchmark since it can't currently be used with webassembly/emscripten

@pytest.fixture
def benchmark():
def result(func, *args, **kwargs):
return func(*args, **kwargs)

return result

def pytest_configure(config):
config.addinivalue_line('markers', 'benchmark: pytest-benchmark stub, ignored')

def pytest_addoption(parser):
parser.addoption('--benchmark-columns', action='store', default='-', help='pytest-benchmark stub, ignored')
parser.addoption('--benchmark-group-by', action='store', default='-', help='pytest-benchmark stub, ignored')
parser.addoption('--benchmark-warmup', action='store', default='-', help='pytest-benchmark stub, ignored')
parser.addoption('--benchmark-disable', action='store_true', default='-', help='pytest-benchmark stub, ignored')
1 change: 1 addition & 0 deletions tests/emscripten_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ async function main() {
await pyodide.loadPackage(['micropip', 'pytest', 'pytz']);
const micropip = pyodide.pyimport('micropip');
await micropip.install('dirty-equals');
await micropip.install('pytest-speed');
await micropip.install(wheelURL);
const pytest = pyodide.pyimport('pytest');
FS.chdir("/test_dir");
Expand Down

0 comments on commit e7988d6

Please sign in to comment.