Fix bug when using `--bless`

This commit is contained in:
Michael Howell 2022-06-18 10:36:12 -07:00
parent b068e6aeb7
commit 29a9f36685
1 changed files with 1 additions and 3 deletions

View File

@ -417,7 +417,7 @@ def check_snapshot(snapshot_name, actual_tree, normalize_to_text):
snapshot_path = '{}.{}.{}'.format(rust_test_path[:-3], snapshot_name, 'html')
try:
with open(snapshot_path, 'r') as snapshot_file:
expected_str = snapshot_file.read()
expected_str = snapshot_file.read().replace("{{channel}}", channel)
except FileNotFoundError:
if bless:
expected_str = None
@ -429,8 +429,6 @@ def check_snapshot(snapshot_name, actual_tree, normalize_to_text):
else:
actual_str = flatten(actual_tree)
expected_str = expected_str.replace("{{channel}}", channel)
# Conditions:
# 1. Is --bless
# 2. Are actual and expected tree different