Skip to content

Commit a9d0990

Browse files
committed
fix
1 parent 77468b7 commit a9d0990

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

_unittests/ut_gdot/test_gdot_extension.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,10 @@ def test_gdot4_png(self):
136136
return
137137
self.assertIn("png", content)
138138

139-
140139
@ignore_warnings(PendingDeprecationWarning)
141140
def test_gdot_script_cache(self):
142141
"""Test that identical scripts are cached and produce the same output."""
143-
script = "print('digraph foo { HbarH -> HbazH; }')".replace("H", '\"')
142+
script = "print('digraph foo { HbarH -> HbazH; }')".replace("H", '"')
144143
content = f"""
145144
before
146145
@@ -163,7 +162,9 @@ def test_gdot_script_cache(self):
163162
)
164163
# Both gdot directives should produce the same DOT output
165164
count = content.count('digraph foo { "bar" -> "baz"; }')
166-
self.assertEqual(count, 2, f"Expected the DOT code to appear twice, got {count}")
165+
self.assertEqual(
166+
count, 2, f"Expected the DOT code to appear twice, got {count}"
167+
)
167168

168169

169170
if __name__ == "__main__":

sphinx_runpython/gdot/sphinx_gdot_extension.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ def run(self):
149149
content = "\n".join(self.content)
150150
if script or script == "":
151151
env = info.get("env")
152-
cache_key = hashlib.sha256(
153-
f"{content}:{process}".encode("utf-8")
154-
).hexdigest()
152+
cache_key = hashlib.sha256(f"{content}:{process}".encode()).hexdigest()
155153
if env is not None:
156154
if not hasattr(env, "gdot_script_cache"):
157155
env.gdot_script_cache = {}

0 commit comments

Comments
 (0)