Skip to content

Commit 9bf5329

Browse files
committed
Add empty space to _xtype_wmsg
1 parent 85290a9 commit 9bf5329

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/diffpy/utils/diffraction_objects.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121

2222
def _xtype_wmsg(xtype):
2323
return (
24-
f"I don't know how to handle the xtype, '{xtype}'. Please rerun specifying an "
25-
f"xtype from {*XQUANTITIES, }"
24+
f"I don't know how to handle the xtype, '{xtype}'. "
25+
f"Please rerun specifying an xtype from {*XQUANTITIES, }"
2626
)
2727

2828

2929
def _setter_wmsg(attribute):
3030
return (
31-
f"Direct modification of attribute '{attribute}' is not allowed."
31+
f"Direct modification of attribute '{attribute}' is not allowed. "
3232
f"Please use 'insert_scattering_quantity' to modify '{attribute}'.",
3333
)
3434

tests/test_diffraction_objects.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ def test_init_invalid_xtype():
215215
with pytest.raises(
216216
ValueError,
217217
match=re.escape(
218-
f"I don't know how to handle the xtype, 'invalid_type'. Please rerun specifying an "
219-
f"xtype from {*XQUANTITIES, }"
218+
f"I don't know how to handle the xtype, 'invalid_type'. "
219+
f"Please rerun specifying an xtype from {*XQUANTITIES, }"
220220
),
221221
):
222222
DiffractionObject(xtype="invalid_type")
@@ -405,7 +405,7 @@ def test_all_array_setter():
405405
# Attempt to directly modify the property
406406
with pytest.raises(
407407
AttributeError,
408-
match="Direct modification of attribute 'all_arrays' is not allowed."
408+
match="Direct modification of attribute 'all_arrays' is not allowed. "
409409
"Please use 'insert_scattering_quantity' to modify 'all_arrays'.",
410410
):
411411
actual_do.all_arrays = np.empty((4, 4))
@@ -432,7 +432,7 @@ def test_input_xtype_setter():
432432
# Attempt to directly modify the property
433433
with pytest.raises(
434434
AttributeError,
435-
match="Direct modification of attribute 'input_xtype' is not allowed."
435+
match="Direct modification of attribute 'input_xtype' is not allowed. "
436436
"Please use 'insert_scattering_quantity' to modify 'input_xtype'.",
437437
):
438438
do.input_xtype = "q"

0 commit comments

Comments
 (0)