add missed file

This commit is contained in:
Ronny Pfannschmidt 2017-03-15 18:11:19 +01:00
parent 92f6ab1881
commit bb750a7945
1 changed files with 21 additions and 0 deletions

21
testing/test_modimport.py Normal file
View File

@ -0,0 +1,21 @@
import py
import subprocess
import sys
import pytest
import _pytest
MODSET = [
x for x in py.path.local(_pytest.__file__).dirpath().visit('*.py')
if x.purebasename != '__init__'
]
@pytest.mark.parametrize('modfile', MODSET, ids=lambda x: x.purebasename)
def test_fileimport(modfile):
res = subprocess.call([
sys.executable,
'-c', 'import sys, py; py.path.local(sys.argv[1]).pyimport()',
modfile.strpath,
])
if res:
pytest.fail("command result %s" % res)