diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-02-11 17:20:24 +0100 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-02-11 17:20:24 +0100 |
commit | 3ea44646f04648d1a456a0fb9526035101fc17ea (patch) | |
tree | ae517187fd90c6f878538748b4b1f550bf1e5790 /src/python/test/test_tangential_complex.py | |
parent | 3253abd27129595f7fcd2be4c2285a93aea98690 (diff) |
Code review: non-optimal way to test filtration generator
Diffstat (limited to 'src/python/test/test_tangential_complex.py')
-rwxr-xr-x | src/python/test/test_tangential_complex.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/python/test/test_tangential_complex.py b/src/python/test/test_tangential_complex.py index 90e2c75b..fc500c45 100755 --- a/src/python/test/test_tangential_complex.py +++ b/src/python/test/test_tangential_complex.py @@ -38,15 +38,14 @@ def test_tangential(): assert st.num_simplices() == 6 assert st.num_vertices() == 4 - filtration_generator = st.get_filtration() - assert(next(filtration_generator) == ([0], 0.0)) - assert(next(filtration_generator) == ([1], 0.0)) - assert(next(filtration_generator) == ([2], 0.0)) - assert(next(filtration_generator) == ([0, 2], 0.0)) - assert(next(filtration_generator) == ([3], 0.0)) - assert(next(filtration_generator) == ([1, 3], 0.0)) - with pytest.raises(StopIteration): - next(filtration_generator) + assert list(st.get_filtration()) == [ + ([0], 0.0), + ([1], 0.0), + ([2], 0.0), + ([0, 2], 0.0), + ([3], 0.0), + ([1, 3], 0.0), + ] assert st.get_cofaces([0], 1) == [([0, 2], 0.0)] |