From 7d9df63cda80db6edcf3b75d9008ea4c4e6605b1 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 8 Feb 2018 13:38:45 -0500 Subject: [PATCH] Simplify conftest for loading hy modules --- conftest.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/conftest.py b/conftest.py index 1a32be3..54ba2e6 100644 --- a/conftest.py +++ b/conftest.py @@ -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)