Debian Codegraph @

extra_tests/test_collections.py

raw symbols SCIP
1 import pytest
2 from collections import namedtuple
3
4 def test_replace_positional_args():
5 nt = namedtuple('T', 'a b')
6 x = nt(1, 2)
7 with pytest.raises(TypeError):
8 x._replace(1)
9
10 def test_empty_replace():
11 nt = namedtuple('empty', '')
12 nt()._replace() # does not crash
13
14