Commits

Ronny Pfannschmidt  committed 3bcc574

kill tool/pytest/modcheck for pytest.importorskip

  • Participants
  • Parent commits 6ec7a3f
  • Branches pytest

Comments (0)

Files changed (2)

File pypy/rpython/module/test/test_ll_os_path.py

 
 import sys, os
 
-from pypy.tool.pytest.modcheck import skipimporterror
-skipimporterror("ctypes")
-
 from pypy.rpython.lltypesystem.module.ll_os_path import Implementation as impl
 from pypy.rpython.module.support import ll_strcpy
 from pypy.rpython.test.test_llinterp import interpret
 from pypy.tool.udir import udir
 
+
+def setup_module(mod):
+    py.test.importorskip('ctypes')
+
 def test_exists():
     filename = impl.to_rstr(str(py.path.local(__file__)))
     assert impl.ll_os_path_exists(filename) == True

File pypy/tool/pytest/modcheck.py

-import py
-
-def skipimporterror(name):
-    if not hasimport(name):
-        __tracebackhide__ = True
-        py.test.skip("cannot import %r module" % (name,))
-
-def hasimport(name):
-    try:
-        __import__(name)
-    except ImportError:
-        return False
-    else:
-        return True