draft example for skipping py2 and py3 only tests on
a per-module level.
This commit is contained in:
parent
f5f3fe54d5
commit
42d63832b7
|
@ -0,0 +1,16 @@
|
|||
import sys
|
||||
import pytest
|
||||
|
||||
py3 = sys.version_info[0] >= 3
|
||||
|
||||
class DummyCollector(pytest.collect.File):
|
||||
def collect(self):
|
||||
return []
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
def test_exception_syntax():
|
||||
try:
|
||||
0/0
|
||||
except ZeroDivisionError, e:
|
||||
assert 0, e
|
||||
|
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
|
||||
def test_exception_syntax():
|
||||
try:
|
||||
0/0
|
||||
except ZeroDivisionError as e:
|
||||
assert 0, e
|
||||
|
Loading…
Reference in New Issue