Skip to content

Commit 664a207

Browse files
author
Sylvain MARIE
committed
Fixed test for pytest 2
1 parent 2a805ed commit 664a207

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pytest_cases/tests/issues/test_issue_fixture_union1.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from distutils.version import LooseVersion
2+
13
import pytest
24
from pytest_cases import fixture_union
35

@@ -15,4 +17,8 @@ def test_foo(u):
1517

1618

1719
def test_synthesis(module_results_dct):
18-
assert list(module_results_dct) == ['test_foo[u_is_a0]', 'test_foo[u_is_a1]']
20+
if LooseVersion(pytest.__version__) < LooseVersion('3.0.0'):
21+
# the way to make ids uniques in case of duplicates was different in old pytest
22+
assert list(module_results_dct) == ['test_foo[u_is_0a]', 'test_foo[u_is_1a]']
23+
else:
24+
assert list(module_results_dct) == ['test_foo[u_is_a0]', 'test_foo[u_is_a1]']

0 commit comments

Comments
 (0)