(self)
| 89 | support.gc_collect() |
| 90 | |
| 91 | def test_bpo_31728(self): |
| 92 | # A crash or an assertion failure shouldn't happen, in case garbage |
| 93 | # collection triggers a call to clear() or a reading of text or tail, |
| 94 | # while a setter or clear() or __setstate__() is already running. |
| 95 | elem = cET.Element('elem') |
| 96 | class X: |
| 97 | def __del__(self): |
| 98 | elem.text |
| 99 | elem.tail |
| 100 | elem.clear() |
| 101 | |
| 102 | elem.text = X() |
| 103 | elem.clear() # shouldn't crash |
| 104 | |
| 105 | elem.tail = X() |
| 106 | elem.clear() # shouldn't crash |
| 107 | |
| 108 | elem.text = X() |
| 109 | elem.text = X() # shouldn't crash |
| 110 | elem.clear() |
| 111 | |
| 112 | elem.tail = X() |
| 113 | elem.tail = X() # shouldn't crash |
| 114 | elem.clear() |
| 115 | |
| 116 | elem.text = X() |
| 117 | elem.__setstate__({'tag': 42}) # shouldn't cause an assertion failure |
| 118 | elem.clear() |
| 119 | |
| 120 | elem.tail = X() |
| 121 | elem.__setstate__({'tag': 42}) # shouldn't cause an assertion failure |
| 122 | |
| 123 | @support.cpython_only |
| 124 | def test_uninitialized_parser(self): |
nothing calls this directly
no test coverage detected