Skip to content

Commit 1d33f2f

Browse files
author
Sylvain MARIE
committed
Improved test for last fix
1 parent eb3c500 commit 1d33f2f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

pytest_cases/tests/pytest_extension/parametrize_plus/test_lazy_value_low_level.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ def foo():
3535
assert mini_idval(a, 'a', 1) == 'foo[%s]' % i
3636
assert ('LazyTupleItem(item=%s' % i) in repr(a)
3737

38-
# # test when the tuple is not unpacked -
39-
# # note: this is not supposed to happen when @parametrize decorates a test function,
40-
# # it only happens when @parametrize decorates a fixture - indeed in that case we generate the whole id ourselves
41-
# assert mini_idval(at, 'a', 1) == 'a1'
42-
# # test that retrieving the tuple does not loose the id
43-
# at.value
44-
# assert mini_idval(at, 'a', 1) == 'foo'
38+
# test when the tuple is not unpacked -
39+
# note: this is not supposed to happen when @parametrize decorates a test function,
40+
# it only happens when @parametrize decorates a fixture - indeed in that case we generate the whole id ourselves
41+
assert str(at) == 'foo'
42+
assert not at.retrieved
43+
# test that retrieving the tuple does not loose the id
44+
v = at.get()
45+
assert v == (1, 2)
46+
assert str(at) == 'foo'
47+
assert at.retrieved
4548

4649

4750
pytest53 = LooseVersion(pytest.__version__) >= LooseVersion("5.3.0")

0 commit comments

Comments
 (0)