white-appointment-6770
12/06/2024, 7:11 PMwith_stmt ::= "with" ( "(" with_stmt_contents ","? ")" | with_stmt_contents ) ":" suite
with_stmt_contents ::= with_item ("," with_item)*
with_item ::= expression ["as" target]
I have a test that uses this format and when I run it with coverage enabled, coverage crashes with something like:
Couldn't parse 'mysystem/python/mysystem/server/v2_1/lib/tests/test_zmq_socket_monitor.py' as Python source: 'invalid syntax' at line 480
stderr:
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
If I remove the parentheses from the with statement and instead separate with something like:
with A() as a, \
B() as b, \
C() as c:
Then the exception goes away.
BUILD file has a py constraint of ">=3.10"
Encountered in pants 2.23.0.
Has anyone else run into this?