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