Skip to content

Commit d0505d1

Browse files
committed
Try raw strings?
1 parent 4803c22 commit d0505d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_pytest_mpl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,10 @@ def test_hash_fails(tmpdir):
305305
assert code == 0
306306

307307

308-
TEST_FAILING_HYBRID = f"""
308+
TEST_FAILING_HYBRID = rf"""
309309
import pytest
310310
import matplotlib.pyplot as plt
311-
@pytest.mark.mpl_image_compare(hash_library="{fail_hash_library}",
311+
@pytest.mark.mpl_image_compare(hash_library=r"{fail_hash_library}",
312312
tolerance=2)
313313
def test_hash_fail_hybrid():
314314
fig = plt.figure()
@@ -326,7 +326,7 @@ def test_hash_fail_hybrid(tmpdir):
326326

327327
# Assert that image comparison runs and fails
328328
output = assert_pytest_fails_with(['--mpl', test_file,
329-
f'--mpl-baseline-path={hash_baseline_dir_abs / "fail"}'],
329+
rf'--mpl-baseline-path={hash_baseline_dir_abs / "fail"}'],
330330
"doesn't match hash FAIL in library")
331331
assert "Error: Image files did not match." in output, output
332332

@@ -338,7 +338,7 @@ def test_hash_fail_hybrid(tmpdir):
338338

339339
# Assert reports image comparison succeeds
340340
output = assert_pytest_fails_with(['--mpl', test_file,
341-
f'--mpl-baseline-path={hash_baseline_dir_abs / "succeed"}'],
341+
rf'--mpl-baseline-path={hash_baseline_dir_abs / "succeed"}'],
342342
"doesn't match hash FAIL in library")
343343
assert "However, the comparison to the baseline image succeeded." in output, output
344344

0 commit comments

Comments
 (0)