Merged in pelme/pytest/py2_pkg_skip (pull request #107)

fixed issue428: Skip test for packages without __init__.py on Python 2
This commit is contained in:
holger krekel 2014-01-22 14:46:22 +01:00
commit d02d0bb7b7
1 changed files with 7 additions and 0 deletions

View File

@ -411,6 +411,13 @@ def test_rewritten():
testdir.tmpdir.join("test_newlines.py").write(b, "wb")
assert testdir.runpytest().ret == 0
@pytest.mark.skipif(sys.version_info[0] == 2,
reason='packages without __init__.py not supported on python 2')
def test_package_without__init__py(self, testdir):
pkg = testdir.mkdir('a_package_without_init_py')
mod = pkg.join('module.py').ensure()
testdir.makepyfile("import a_package_without_init_py.module")
assert testdir.runpytest().ret == 0
class TestAssertionRewriteHookDetails(object):
def test_loader_is_package_false_for_module(self, testdir):