@@ -479,7 +479,7 @@ def test_clean_runnable_blocks_nodoc_collapses_blank_lines(self):
479479
480480 def test_clean_runnable_blocks_glmasr_batched (self ):
481481 """Real-world test from huggingface/transformers PR #44277 — test_batched block with # nodoc."""
482- text = ''' ```py runnable:test_batched
482+ text = """ ```py runnable:test_batched
483483import torch
484484from transformers import AutoProcessor, GlmAsrForConditionalGeneration
485485
@@ -540,8 +540,8 @@ def test_clean_runnable_blocks_glmasr_batched(self):
540540 "This week, I traveled to Chicago to deliver my final farewell address to the nation.",
541541]
542542assert decoded_outputs == EXPECTED_OUTPUT # nodoc
543- ```'''
544- expected = ''' ```py
543+ ```"""
544+ expected = """ ```py
545545import torch
546546from transformers import AutoProcessor, GlmAsrForConditionalGeneration
547547
@@ -586,12 +586,12 @@ def test_clean_runnable_blocks_glmasr_batched(self):
586586decoded_outputs = processor.batch_decode(
587587 outputs[:, inputs.input_ids.shape[1] :], skip_special_tokens=True
588588)
589- ```'''
589+ ```"""
590590 self .assertEqual (clean_runnable_blocks (text ), expected )
591591
592592 def test_clean_runnable_blocks_glmasr_basic (self ):
593593 """Real-world test from huggingface/transformers PR #44277 — test_basic block (no asserts)."""
594- text = ''' ```py runnable:test_basic
594+ text = """ ```py runnable:test_basic
595595from transformers import AutoModelForSeq2SeqLM, AutoProcessor
596596
597597processor = AutoProcessor.from_pretrained("zai-org/GLM-ASR-Nano-2512")
@@ -606,8 +606,8 @@ def test_clean_runnable_blocks_glmasr_basic(self):
606606
607607decoded_outputs = processor.batch_decode(outputs[:, inputs.input_ids.shape[1] :], skip_special_tokens=True)
608608print(decoded_outputs)
609- ```'''
610- expected = ''' ```py
609+ ```"""
610+ expected = """ ```py
611611from transformers import AutoModelForSeq2SeqLM, AutoProcessor
612612
613613processor = AutoProcessor.from_pretrained("zai-org/GLM-ASR-Nano-2512")
@@ -622,5 +622,5 @@ def test_clean_runnable_blocks_glmasr_basic(self):
622622
623623decoded_outputs = processor.batch_decode(outputs[:, inputs.input_ids.shape[1] :], skip_special_tokens=True)
624624print(decoded_outputs)
625- ```'''
625+ ```"""
626626 self .assertEqual (clean_runnable_blocks (text ), expected )
0 commit comments