Merge pull request #1499 from vodik/conftest-cleanup

Simplify conftest for loading hy modules
This commit is contained in:
Tuukka Turto 2018-02-12 06:49:25 +02:00 committed by GitHub
commit 6b23da6997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import _pytest
import pytest
import hy
import os
from hy._compat import PY3, PY35, PY36
@ -12,7 +12,4 @@ def pytest_collect_file(parent, path):
and not ("py3_only" in path.basename and not PY3)
and not ("py35_only" in path.basename and not PY35)
and not ("py36_only" in path.basename and not PY36)):
m = _pytest.python.pytest_pycollect_makemodule(path, parent)
# Spoof the module name to avoid hitting an assertion in pytest.
m.name = m.name[:-len(".hy")] + ".py"
return m
return pytest.Module(path, parent)