MCPcopy Index your code
hub / github.com/python/cpython / test_positional_only_parameter

Method test_positional_only_parameter

Lib/test/test_xml_etree.py:384–395  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

382 '<tag key="value"><subtag /><subtag /></tag>')
383
384 def test_positional_only_parameter(self):
385 # Test Element positional-only parameters (gh-144846).
386
387 # 'tag' is positional-only
388 with self.assertRaises(TypeError):
389 ET.Element(tag='fail')
390
391 # 'tag' and 'attrib' as kwarg/attribute names
392 e = ET.Element('e', attrib={'attrib': 'foo'}, tag='bar')
393 self.assertEqual(e.tag, 'e')
394 self.assertEqual(e.get('attrib'), 'foo')
395 self.assertEqual(e.get('tag'), 'bar')
396
397 def test_cdata(self):
398 # Test CDATA handling (etc).

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected