1# Copyright (c) 2016 Ultimaker B.V.
2# Uranium is released under the terms of the LGPLv3 or higher.
3
4import pytest
5import warnings
6
7warn = True
8
9@pytest.hookimpl
10def pytest_ignore_collect(path, config):
11    if config.pluginmanager.hasplugin("pytest-benchmark"):
12        return False
13    else:
14        global warn
15        if warn:
16            warnings.warn(pytest.PytestWarning("Skipping benchmarks because pytest-benchmark plugin was not found."))
17            warn = False
18
19        return True
20