@@ -88,18 +88,12 @@ def test_init_without_api_key_raises(self):
8888
8989 def test_init_with_custom_model (self ):
9090 """Test initialization with custom model."""
91- summarizer = Summarizer (
92- api_key = TEST_API_KEY ,
93- model = "claude-3-5-sonnet-20241022"
94- )
91+ summarizer = Summarizer (api_key = TEST_API_KEY , model = "claude-3-5-sonnet-20241022" )
9592 assert summarizer .model == "claude-3-5-sonnet-20241022"
9693
9794 def test_init_with_custom_max_tokens (self ):
9895 """Test initialization with custom max_tokens."""
99- summarizer = Summarizer (
100- api_key = TEST_API_KEY ,
101- max_tokens = 8192
102- )
96+ summarizer = Summarizer (api_key = TEST_API_KEY , max_tokens = 8192 )
10397 assert summarizer .max_tokens == 8192
10498
10599 def test_init_with_invalid_model_raises (self ):
@@ -312,7 +306,9 @@ def test_build_prompt_limits_files(self, summarizer, sample_scope):
312306 assert "file9.py" in prompt
313307 assert "and 5 more files" in prompt
314308
315- def test_build_prompt_includes_yaml_instructions (self , summarizer , sample_context , sample_scope ):
309+ def test_build_prompt_includes_yaml_instructions (
310+ self , summarizer , sample_context , sample_scope
311+ ):
316312 """Test that prompt includes YAML instructions."""
317313 prompt = summarizer ._build_prompt (sample_context , sample_scope )
318314
@@ -406,7 +402,9 @@ def test_build_document_index_refs(self, summarizer, sample_context, sample_scop
406402 assert 123 in doc_index .refs .issues
407403 assert "abc123" in doc_index .refs .commits
408404
409- def test_build_document_index_uses_context_files (self , summarizer , sample_context , sample_scope ):
405+ def test_build_document_index_uses_context_files (
406+ self , summarizer , sample_context , sample_scope
407+ ):
410408 """Test that files_changed comes from context."""
411409 parsed = yaml .safe_load (SAMPLE_YAML_RESPONSE )
412410 doc_index = summarizer ._build_document_index (parsed , sample_context , sample_scope )
@@ -532,7 +530,9 @@ def test_generate_markdown_summary(self, summarizer, sample_doc_index):
532530 assert "Add login feature" in markdown
533531 assert "Implements user authentication" in markdown
534532
535- def test_generate_markdown_changes (self , summarizer , sample_doc_index , sample_context_with_diff ):
533+ def test_generate_markdown_changes (
534+ self , summarizer , sample_doc_index , sample_context_with_diff
535+ ):
536536 """Test changes section with diff."""
537537 markdown = summarizer ._generate_markdown (sample_doc_index , sample_context_with_diff )
538538
@@ -655,7 +655,9 @@ def test_summarize_returns_tuple(self, mock_anthropic_response, sample_context,
655655 assert isinstance (result [0 ], DocumentIndex )
656656 assert isinstance (result [1 ], str )
657657
658- def test_summarize_calls_api_correctly (self , mock_anthropic_response , sample_context , sample_scope ):
658+ def test_summarize_calls_api_correctly (
659+ self , mock_anthropic_response , sample_context , sample_scope
660+ ):
659661 """Test that API is called with correct parameters."""
660662 with patch ("memdocs.summarize.anthropic.Anthropic" ) as mock_client_class :
661663 mock_client = MagicMock ()
@@ -707,7 +709,9 @@ def test_summarize_handles_unexpected_content_block(self, sample_context, sample
707709 with pytest .raises (ValueError , match = "Unexpected content block type" ):
708710 summarizer .summarize (sample_context , sample_scope )
709711
710- def test_summarize_checks_rate_limit (self , mock_anthropic_response , sample_context , sample_scope ):
712+ def test_summarize_checks_rate_limit (
713+ self , mock_anthropic_response , sample_context , sample_scope
714+ ):
711715 """Test that rate limiter is checked before API call."""
712716 with patch ("memdocs.summarize.anthropic.Anthropic" ) as mock_client_class :
713717 mock_client = MagicMock ()
@@ -834,7 +838,7 @@ def test_special_characters_in_commit_message(self):
834838 diff = GitDiff (
835839 commit = "abc123" ,
836840 author = "Test <[email protected] >" ,
837- message = " Fix bug with `code` and <html> & \ " quotes\" " ,
841+ message = ' Fix bug with `code` and <html> & "quotes"' ,
838842 timestamp = datetime .now (timezone .utc ).isoformat (),
839843 added_files = [],
840844 modified_files = [],
0 commit comments