From fe4cdd8a90a601cf0ccb33320d04d5a90c8a15f8 Mon Sep 17 00:00:00 2001 From: Andreas Pelme Date: Wed, 22 Jan 2014 14:32:22 +0100 Subject: [PATCH] fixed issue428: Skip test for packages without __init__.py on Python 2 --HG-- branch : py2_pkg_skip --- testing/test_assertrewrite.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 556249617..d19ebd1d4 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -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):