Skip to content

Commit b673485

Browse files
committed
Prevent black from formatting certain blocks
Otherwise, the lines reformatted by black would be too long.
1 parent 5af88cb commit b673485

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

pelican/plugins/graphviz/test_graphviz.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,20 @@ def setUp(
8080
def test_md(self):
8181
options_string = ""
8282
if self.config["options"]:
83+
# fmt: off
8384
kvs = ",".join(
8485
f'{k}="{v}"' for k, v in self.config["options"].items()
8586
)
87+
# fmt: on
8688
options_string = f"[{kvs}]"
8789

8890
# Create the article file
91+
# fmt: off
8992
with open(
9093
os.path.join(self.content_path, f"{TEST_FILE_STEM}.md"),
9194
"w"
9295
) as fid:
96+
# fmt: on
9397
# Write header
9498
fid.write(f"Title: {TEST_FILE_STEM}\nDate: 1970-01-01\n")
9599
# Write Graphviz block
@@ -113,10 +117,12 @@ def test_rst(self):
113117
f" :{k}: {v}" for k, v in self.config["options"].items()
114118
)
115119

120+
# fmt: off
116121
with open(
117122
os.path.join(self.content_path, f"{TEST_FILE_STEM}.rst"),
118123
"w"
119124
) as fid:
125+
# fmt: on
120126
rst_input = f"""\
121127
{TEST_FILE_STEM}
122128
################
@@ -144,9 +150,11 @@ def run_pelican(self):
144150
def assert_expected_output(self):
145151
"""Test for default values of the configuration variables."""
146152
# Open the output HTML file
153+
# fmt: off
147154
with open(
148155
os.path.join(self.output_path, f"{TEST_FILE_STEM}.html")
149156
) as fid:
157+
# fmt: on
150158
# Keep content as a string so we can see full content in output
151159
# from failed asserts.
152160
content = fid.read()

0 commit comments

Comments
 (0)