<!-- Thanks for submitting an issue! Here's a quick checklist for what to provide: --> Hi, In my use case I need to skip all tests in some python package. For this purpose I added `pytestmark` to `__init__.py`: ```python # __init__.py import pytest pytestmark = pytest.mark.skip ``` I expect all tests to be skipped in this package. However, the first test in this package runs. Here is a failed test for this issue: ```python def test_skip_package(testdir): testdir.makepyfile( __init__=""" import pytest pytestmark = pytest.mark.skip """ ) testdir.makepyfile( """ import pytest def test_skip1(): assert 0 def test_skip2(): assert 0 """ ) result = testdir.inline_run() _, skipped, _ = result.listoutcomes() assert len(skipped) == 2 ```
Activity
asottile commentedon Nov 15, 2019
just a heads up, I'm looking to revert this in #6197 (at least temporarily) as it caused some regressions
asottile commentedon Nov 15, 2019
asottile commentedon Nov 15, 2019
blueyed commentedon Nov 15, 2019
@zefirior
As asked in #6197 (comment): aren't you supposed to have
-o python_filesto include the__init__.py(as a package)?Merge #76
Merge #103
Fix regression: don't import __init__.py from non-test packages