hy/conftest.py

16 lines
537 B
Python
Raw Normal View History

import pytest
2017-04-26 23:00:11 +02:00
import hy
2017-08-31 07:36:06 +02:00
import os
2017-12-30 23:31:06 +01:00
from hy._compat import PY3, PY35, PY36
2017-04-26 23:00:11 +02:00
2017-08-31 07:36:06 +02:00
NATIVE_TESTS = os.path.join("", "tests", "native_tests", "")
2017-04-26 23:00:11 +02:00
def pytest_collect_file(parent, path):
if (path.ext == ".hy"
2017-08-31 07:36:06 +02:00
and NATIVE_TESTS in path.dirname + os.sep
2017-04-26 23:00:11 +02:00
and path.basename != "__init__.hy"
2017-07-17 22:34:39 +02:00
and not ("py3_only" in path.basename and not PY3)
2017-12-30 23:31:06 +01:00
and not ("py35_only" in path.basename and not PY35)
and not ("py36_only" in path.basename and not PY36)):
return pytest.Module(path, parent)