Skip to content

Commit

Permalink
Merge pull request #1499 from vodik/conftest-cleanup
Browse files Browse the repository at this point in the history
Simplify conftest for loading hy modules
  • Loading branch information
tuturto authored Feb 12, 2018
2 parents 4cb1876 + 7d9df63 commit 6b23da6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import _pytest
import pytest
import hy
import os
from hy._compat import PY3, PY35, PY36
Expand All @@ -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)

0 comments on commit 6b23da6

Please sign in to comment.