test_ok1/doc/en/example/py2py3/conftest.py

16 lines
323 B
Python
Raw Normal View History

import sys
import pytest
py3 = sys.version_info[0] >= 3
2018-05-23 22:48:46 +08:00
class DummyCollector(pytest.collect.File):
def collect(self):
return []
2018-05-23 22:48:46 +08:00
def pytest_pycollect_makemodule(path, parent):
bn = path.basename
if "py3" in bn and not py3 or ("py2" in bn and py3):
return DummyCollector(path, parent=parent)