Skip to content
Merged
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
13 changes: 13 additions & 0 deletions validphys2/src/validphys/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Pytest fixtures.
"""
import pathlib
import sys

import pytest
from hypothesis import settings
Expand Down Expand Up @@ -84,3 +85,15 @@ def weighted_data_witht0_config(data_witht0_config):
config_dict = dict(data_witht0_config)
config_dict.update({'experiments': WEIGHTED_DATA})
return config_dict

def pytest_runtest_setup(item):
ALL = {"darwin", "linux"}
supported_platforms = ALL.intersection(mark.name for mark in item.iter_markers())
plat = sys.platform
if supported_platforms and plat not in supported_platforms:
pytest.skip("cannot run on platform {}".format(plat))

def pytest_configure(config):
config.addinivalue_line(
"markers", "linux: mark test to run only on linux"
)
3 changes: 3 additions & 0 deletions validphys2/src/validphys/tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from validphys.api import API

@pytest.mark.linux
@pytest.mark.mpl_image_compare
def test_plotpdfs():
pdfs = ['NNPDF31_nnlo_as_0118']
Expand All @@ -14,6 +15,7 @@ def test_plotpdfs():
#plot_pdfs returns a generator with (figure, name_hint)
return next(API.plot_pdfs(pdfs=pdfs, Q=Q, flavours=flavours))[0]

@pytest.mark.linux
@pytest.mark.mpl_image_compare
def test_dataspecschi2():
experiments = [
Expand All @@ -34,6 +36,7 @@ def test_dataspecschi2():
return API.plot_dataspecs_datasets_chi2(
experiments=experiments, dataspecs=dataspecs, use_cuts='nocuts')

@pytest.mark.linux
@pytest.mark.mpl_image_compare
def test_plot_xq2():
theoryid = 53
Expand Down