Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
f95aa29
refactor: convert setUp/tearDown to pytest autouse fixture
johbo Dec 29, 2025
f627b3d
refactor: convert assertions batch 1 (11 basic main() tests)
johbo Dec 29, 2025
daddb12
refactor: convert assertions batch 2 (18 env & config tests)
johbo Dec 29, 2025
5614fa6
refactor: convert assertions batch 3 (model config tests)
johbo Dec 29, 2025
0873857
refactor: convert assertions batch 4 (remaining tests)
johbo Dec 29, 2025
08105e7
refactor: remove unittest.TestCase inheritance
johbo Dec 29, 2025
47371bf
style: Apply code formatting
johbo Dec 29, 2025
92e11d8
refactor: parametrize boolean flag tests (Phase 3A.1)
johbo Dec 29, 2025
8d070c5
refactor: parametrize API key tests (Phase 3A.2)
johbo Dec 29, 2025
4c5a459
refactor: parametrize --set-env tests (Phase 3A.3)
johbo Dec 29, 2025
973e22c
refactor: parametrize mode tests (Phase 3A.4)
johbo Dec 29, 2025
e897414
refactor: split default model selection test (Phase 3A.5)
johbo Dec 29, 2025
4db7593
refactor: parametrize main args tests (Phase 3A.6)
johbo Dec 29, 2025
a464a93
refactor: extract dummy_io fixture (Phase 3B.1)
johbo Dec 29, 2025
f4191b0
refactor: extract mock_coder fixture (Phase 3B.2)
johbo Dec 30, 2025
e4eaeed
refactor: add git_temp_dir fixture (Phase 3B.3)
johbo Dec 30, 2025
f3cd1bc
refactor: convert create_env_file to factory fixture (Phase 3B.4)
johbo Dec 30, 2025
6fce41b
refactor: convert @patch decorators to mocker (Phase 3C.1a)
johbo Dec 30, 2025
15725e7
refactor: convert with patch to mocker (Phase 3C.1b)
johbo Dec 30, 2025
5f51ae1
refactor: convert more with patch to mocker (Phase 3C.1c)
johbo Dec 30, 2025
6f1c4df
refactor: convert additional with patch to mocker (Phase 3C.1d)
johbo Dec 30, 2025
803d96f
refactor: convert more with patch to mocker (Phase 3C.1e)
johbo Dec 30, 2025
8bedf34
refactor: convert more with patch to mocker (Phase 3C.1f)
johbo Dec 30, 2025
e4653a0
refactor: complete pytest-mock adoption (Phase 3C.1)
johbo Dec 30, 2025
33d6cc9
refactor: modernize test_env fixture (Phase 3C.3)
johbo Dec 30, 2025
4c46a44
refactor: adopt monkeypatch for env vars (Phase 3C.4)
johbo Dec 30, 2025
ebc4bd0
refactor: convert to function-based tests (Phase 3D)
johbo Dec 30, 2025
c8b3252
refactor: consolidate smoke tests into test_main.py (Phase 3E)
johbo Dec 30, 2025
9b69626
refactor: remove redundant smoke test
johbo Dec 30, 2025
3dc217b
refactor: remove redundant async smoke test
johbo Dec 30, 2025
fb4526f
fix: correct typo in test function name (emptqy -> empty)
johbo Dec 30, 2025
6ba3154
refactor: apply clean code principles to test_main.py
johbo Dec 30, 2025
fe15fd6
refactor: eliminate redundant GitTemporaryDirectory usage in 13 tests
johbo Dec 30, 2025
2e57cfc
refactor: use mocker.patch.dict for environment isolation
johbo Dec 30, 2025
65d718c
style: remove obvious comments from test_env fixture
johbo Dec 30, 2025
11696ce
refactor: use context managers for IgnorantTemporaryDirectory
johbo Dec 30, 2025
a55a2fa
refactor: use ChdirTemporaryDirectory for automatic chdir management
johbo Dec 30, 2025
1e4ee93
refactor: extract temp_home fixture for better separation of concerns
johbo Dec 30, 2025
106d555
refactor: extract temp_cwd fixture for working directory management
johbo Dec 30, 2025
b29a5f7
refactor: remove unnecessary yield from test_env fixture
johbo Dec 30, 2025
6d00340
refactor: remove unnecessary create_env_file fixture
johbo Dec 30, 2025
6a54175
refactor: remove unused assert_warning_contains helper
johbo Dec 30, 2025
5014871
refactor: split test_gitignore_files_flag into two focused tests
johbo Dec 30, 2025
3da705c
refactor: remove module docstring
johbo Dec 30, 2025
9c9e3e5
style: Ensure that linting rules are followed
johbo Dec 30, 2025
738302a
Merge upstream/main into test-main-pytest
johbo Dec 30, 2025
72f92fb
fix: remove clear=True from test_env to preserve PATH on Windows
johbo Dec 30, 2025
f91c5b5
refactor: rename tests for clarity
johbo Dec 30, 2025
5a42d6d
refactor: use capsys fixture for stdout capture
johbo Dec 30, 2025
da0eb65
refactor: use tmp_path fixture for temporary files
johbo Dec 30, 2025
535c3ed
refactor: use Path.resolve()
johbo Dec 30, 2025
f933d1b
refactor: convert test_reasoning from unittest to pytest
johbo Dec 31, 2025
ea40671
Migrate 9 test files from unittest to pytest
johbo Dec 31, 2025
aebe5ce
refactor: migrate test_repomap from unittest to pytest
johbo Dec 31, 2025
d187e3c
refactor: migrate test_skills from unittest to pytest
johbo Dec 31, 2025
92f6cef
refactor: migrate test_editblock from unittest to pytest
johbo Dec 31, 2025
5ad0dee
refactor: migrate test_find_or_blocks from unittest to pytest
johbo Dec 31, 2025
0e1075f
refactor: migrate test_benchmark from unittest to pytest
johbo Dec 31, 2025
96121f2
refactor: migrate test_onboarding from unittest to pytest
johbo Dec 31, 2025
36af846
refactor: migrate test_io.py from unittest to pytest
johbo Dec 31, 2025
21fcfbb
refactor: migrate test_repo.py from unittest to pytest
johbo Dec 31, 2025
08ce47f
refactor: migrate test_coder.py from unittest to pytest
johbo Dec 31, 2025
a4e3aff
fix: resolve test failures in test_io.py and test_editblock.py
johbo Dec 31, 2025
c60824d
fix: update test expectations for aider-ce rename
johbo Dec 31, 2025
1e3de03
fix: complete pytest migration for test_onboarding.py
johbo Dec 31, 2025
0dcef76
fix: correct syntax error in test_normalize_language
johbo Dec 31, 2025
a0d1a7e
fix: correct mock response in test_full_edit
johbo Dec 31, 2025
f79c5f6
fix: convert mock_send return statements to async generators
johbo Dec 31, 2025
aa831e1
fix: update test_get_files_content for API change
johbo Dec 31, 2025
7b8a5e0
fix: add missing await and convert mock_send to async generators
johbo Dec 31, 2025
40afc99
fix: correct async generator usage in error handling tests
johbo Dec 31, 2025
f4a1d75
fix: convert mock functions to async in commit tests
johbo Dec 31, 2025
ff5773e
fix: convert mock functions to async in test_gpt_edit_to_existing_fil…
johbo Dec 31, 2025
2c498ae
fix: add missing await in test_show_exhausted_error
johbo Dec 31, 2025
edb230e
fix: correct pytest usage in test_unknown_edit_format_creation
johbo Dec 31, 2025
031500d
fix: use AsyncMock for handle_shell_commands in test_suggest_shell_co…
johbo Dec 31, 2025
e4982ed
fix: correct MCP server tests
johbo Dec 31, 2025
8e7c97b
fix: use AsyncMock for confirm_ask in test_process_tool_calls_with_tools
johbo Dec 31, 2025
ef95f63
fix: resolve test_coder.py failures (42/54 passing, 12 xfailed)
johbo Dec 31, 2025
a74c87d
chore: remove dead __test_ methods from test_editblock.py
johbo Jan 1, 2026
15c158c
chore: remove if __name__ == "__main__" blocks from test files
johbo Jan 1, 2026
0ae64d8
fix: correct pricing calculation for providers using $/token format
chrisnestrud Jan 1, 2026
4724a83
chore: remove obvious comments and add follow-up note for xfail
johbo Jan 1, 2026
3bc387f
feat: create tests/conftest.py with shared fixtures
johbo Jan 1, 2026
fe0c9d7
refactor: use gpt35_model fixture in test_editblock.py
johbo Jan 1, 2026
a8b6491
refactor: use gpt35_model fixture in test_wholefile.py
johbo Jan 1, 2026
6cca23d
refactor: use gpt35_model fixture in test_io.py
johbo Jan 1, 2026
fa24d82
refactor: use gpt35_model fixture in test_repo.py
johbo Jan 1, 2026
d180127
refactor: use shared fixtures from conftest.py
johbo Jan 1, 2026
94443c4
refactor: split large test_io.py test methods into focused units
johbo Jan 1, 2026
97095c4
refactor: parametrize test_parse_model_with_suffix in test_models.py
johbo Jan 1, 2026
8204f4a
docs: improve async generator pattern documentation
johbo Jan 1, 2026
eb89974
refactor: standardize skip markers in test_linter.py
johbo Jan 1, 2026
9c7cde8
refactor: remove empty TestRepoMapTypescript class
johbo Jan 1, 2026
e1cbe0c
fix: remove misleading comment in test_io.py
johbo Jan 1, 2026
4198e17
refactor: simplify mock classes by removing unnecessary fixtures
johbo Jan 1, 2026
6b8b3ef
style: add blank lines around yield in fixture for clarity
johbo Jan 1, 2026
388e6d1
refactor: parametrize line ending validation test
johbo Jan 1, 2026
f3e633e
docs: remove internal MR reference from TODO comment
johbo Jan 1, 2026
a889508
Bump Version
dwash96 Jan 1, 2026
7a06d89
Merge pull request #344 from chrisnestrud/fix/pricing
dwash96 Jan 1, 2026
afef34a
docs: restore explanatory comments in test_models.py
johbo Jan 1, 2026
a9373ca
docs: restore explanatory comments in test_models.py (batch 2)
johbo Jan 1, 2026
d7390cc
docs: restore section comments in test_models.py (batch 3)
johbo Jan 1, 2026
79e352a
chore: remove unittest.main() block from test_scrape.py
johbo Jan 1, 2026
4bc4e4f
docs: restore section comments in test_models.py (batch 4)
johbo Jan 1, 2026
2641a3f
Merge upstream/main
johbo Jan 1, 2026
eed79a2
feat: restore test_cmd_web_imports_playwright test
johbo Jan 1, 2026
69404b4
fix: resolve test failures from upstream merge
johbo Jan 1, 2026
1fe9ab5
style: fix pre-commit linting issues in tests
johbo Jan 1, 2026
1e883ac
docs: remove outdated comment in test_coder.py
johbo Jan 1, 2026
c06df91
docs: remove unittest.main() migration comment
johbo Jan 1, 2026
a5aed4b
Merge pull request #348 from johbo/tests-unittest-to-pytest
dwash96 Jan 1, 2026
6d940a6
fix: handle missing args attribute in ArchitectCoder
johbo Jan 1, 2026
21fac93
test: fix ArchitectCoder tests to match actual behavior
johbo Jan 1, 2026
bb42927
fix: set args in ArchitectCoder tests instead of production workaround
johbo Jan 1, 2026
5b3e7b7
refactor: use Coder.create() in ArchitectCoder tests
johbo Jan 1, 2026
3124091
Merge pull request #349 from johbo/fix-xfail-tests
dwash96 Jan 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aider/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from packaging import version

__version__ = "0.91.5.dev"
__version__ = "0.92.0.dev"
safe_version = __version__

try:
Expand Down
2 changes: 1 addition & 1 deletion aider/coders/base_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@ async def check_and_open_urls(self, exc, friendly_msg=None):

async def check_for_urls(self, inp: str) -> List[str]:
"""Check input for URLs and offer to add them to the chat."""
if not self.detect_urls or self.args.disable_scraping:
if not self.detect_urls or (self.args and self.args.disable_scraping):
return inp

# Exclude double quotes from the matched URL characters
Expand Down
18 changes: 14 additions & 4 deletions aider/helpers/model_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,24 @@ def _record_to_info(self, record: Dict, provider: str) -> Dict:
if max_output_tokens is None:
max_output_tokens = context_len

# Normalize pricing: detect if values are in $/M format vs $/token format
# If cost >= 0.001, it's likely in $/M format (e.g., "1.0" = $1/M tokens)
# If cost < 0.001, it's likely already in $/token format (e.g., "0.00000055")
def _normalize_cost(cost: Optional[float]) -> float:
if cost is None or cost == 0:
return 0.0
if cost >= 0.001:
# Likely in $/M format, convert to $/token
return cost / self.DEFAULT_TOKEN_PRICE_RATIO
# Already in $/token format
return cost

info = {
"max_input_tokens": context_len,
"max_tokens": max_tokens,
"max_output_tokens": max_output_tokens,
"input_cost_per_token": (
input_cost or 0
) / self.DEFAULT_TOKEN_PRICE_RATIO, # Might Only Apply to Chutes and Be a thing we configure per-provider
"output_cost_per_token": (output_cost or 0) / self.DEFAULT_TOKEN_PRICE_RATIO,
"input_cost_per_token": _normalize_cost(input_cost),
"output_cost_per_token": _normalize_cost(output_cost),
"litellm_provider": provider,
"mode": record.get("mode", "chat"),
}
Expand Down
10 changes: 4 additions & 6 deletions benchmark/test_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# flake8: noqa: E501

import unittest

from benchmark import cleanup_test_output


class TestCleanupTestOutput(unittest.TestCase):
class TestCleanupTestOutput:
def test_cleanup_test_output(self):
# Test case with timing info
output = "Ran 5 tests in 0.003s\nOK"
expected = "\nOK"
self.assertEqual(cleanup_test_output(output), expected)
assert cleanup_test_output(output) == expected

# Test case without timing info
output = "OK"
expected = "OK"
self.assertEqual(cleanup_test_output(output), expected)
assert cleanup_test_output(output) == expected

def test_cleanup_test_output_lines(self):
# Test case with timing info
Expand Down Expand Up @@ -44,4 +42,4 @@ def test_cleanup_test_output_lines(self):
+ OKx
? +
"""
self.assertEqual(cleanup_test_output(output), expected)
assert cleanup_test_output(output) == expected
Loading
Loading