2012-05-24 05:40:41 +08:00
|
|
|
import sys
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
py3 = sys.version_info[0] >= 3
|
|
|
|
|
2018-05-23 22:48:46 +08:00
|
|
|
|
2012-05-24 05:40:41 +08:00
|
|
|
class DummyCollector(pytest.collect.File):
|
|
|
|
def collect(self):
|
|
|
|
return []
|
|
|
|
|
2018-05-23 22:48:46 +08:00
|
|
|
|
2012-05-24 05:40:41 +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)
|