@@ -354,38 +354,24 @@ def test_to_json() -> None:
354354
355355
356356def test_immutable () -> None :
357- # Match one of two strings. The second one is message returned since python 3.11.
358- with pytest .raises (
359- AttributeError ,
360- match = "(can't set attribute)|(property 'col' of 'GridQubit' object has no setter)" ,
361- ):
357+ with pytest .raises (AttributeError , match = "property 'col' of 'GridQubit' object has no setter" ):
362358 q = cirq .GridQubit (1 , 2 )
363359 q .col = 3 # type: ignore[misc]
364360
365- with pytest .raises (
366- AttributeError ,
367- match = "(can't set attribute)|(property 'row' of 'GridQubit' object has no setter)" ,
368- ):
361+ with pytest .raises (AttributeError , match = "property 'row' of 'GridQubit' object has no setter" ):
369362 q = cirq .GridQubit (1 , 2 )
370363 q .row = 3 # type: ignore[misc]
371364
372- with pytest .raises (
373- AttributeError ,
374- match = "(can't set attribute)|(property 'col' of 'GridQid' object has no setter)" ,
375- ):
365+ with pytest .raises (AttributeError , match = "property 'col' of 'GridQid' object has no setter" ):
376366 qid = cirq .GridQid (1 , 2 , dimension = 3 )
377367 qid .col = 3 # type: ignore[misc]
378368
379- with pytest .raises (
380- AttributeError ,
381- match = "(can't set attribute)|(property 'row' of 'GridQid' object has no setter)" ,
382- ):
369+ with pytest .raises (AttributeError , match = "property 'row' of 'GridQid' object has no setter" ):
383370 qid = cirq .GridQid (1 , 2 , dimension = 3 )
384371 qid .row = 3 # type: ignore[misc]
385372
386373 with pytest .raises (
387- AttributeError ,
388- match = "(can't set attribute)|(property 'dimension' of 'GridQid' object has no setter)" ,
374+ AttributeError , match = "property 'dimension' of 'GridQid' object has no setter"
389375 ):
390376 qid = cirq .GridQid (1 , 2 , dimension = 3 )
391377 qid .dimension = 3 # type: ignore[misc]
0 commit comments