diff --git a/tests/trestle/core/control_io_test.py b/tests/trestle/core/control_io_test.py index 9c262a768..72564c5a2 100644 --- a/tests/trestle/core/control_io_test.py +++ b/tests/trestle/core/control_io_test.py @@ -46,7 +46,7 @@ case_3 = 'indent end abrupt' case_4 = 'no items' -control_text = """--- +control_text = r"""--- x-trestle-global: sort-id: xy-09 --- @@ -132,7 +132,7 @@ def test_read_write_controls( part_b3 = common.Part(id='ac-1_smt.b.3', name='item', prose='b.3 prose', props=[prop]) prop.value = 'c' part_c = common.Part(id='ac-1_smt.c', name='item', prose='c prose', props=[prop]) - sec_1_text = """ + sec_1_text = r""" General comment on separate lines @@ -425,7 +425,7 @@ def test_merge_control_update(tmp_path: pathlib.Path, testdata_dir: pathlib.Path assert context.comp_dict['This System']['d.'].status.state == 'planned', 'New template state must be merged' -statement_text = """ +statement_text = r""" # xy-9 - \[My Group Title\] Fancy Control diff --git a/trestle/core/control_interface.py b/trestle/core/control_interface.py index 71fe3c456..ab3c4c95e 100644 --- a/trestle/core/control_interface.py +++ b/trestle/core/control_interface.py @@ -109,8 +109,8 @@ class ControlInterface: @staticmethod def _wrap_label(label: str): - l_side = '\[' - r_side = '\]' + l_side = r'\[' + r_side = r'\]' wrapped = '' if label == '' else f'{l_side}{label}{r_side}' return wrapped diff --git a/trestle/core/control_writer.py b/trestle/core/control_writer.py index f05b2313c..00bd5ccc3 100644 --- a/trestle/core/control_writer.py +++ b/trestle/core/control_writer.py @@ -66,7 +66,7 @@ def _add_control_statement(self, control: cat.Control, group_title: str, print_g control_title = control.title if print_group_title: - group_name = ' \[' + group_title + '\]' + group_name = r' \[' + group_title + r'\]' title = f'{control_id} -{group_name} {control_title}'