Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.

Conversation

@erlapso
Copy link
Contributor

@erlapso erlapso commented Jan 31, 2025

An example PR to show how CodeBeaver works. It contains:

  • 2 test files with 2 tests each that need to be updated
  • 2 missing test files
  • expense_tracker.py has a bug!

Want to see how CodeBeaver would fare against other code? Just open a Pull Request on this repo! CodeBeaver will trigger and analyze your PR

@codebeaver-ai codebeaver-ai deleted a comment from codebeaver-ai bot Feb 3, 2025
@codebeaver-ai
Copy link
Contributor

codebeaver-ai bot commented Feb 3, 2025

CodeBeaver PR Summary

I opened a Pull Request with the following:

🔄 4 tests added and 4 tests updated to reflect recent changes.
🐛 Found 1 bug
🛠️ 15/15 tests passed

🔄 Test Updates

I've added or updated 6 tests. They all pass ☑️
Updated Tests:

  • tests/test_expense_tracker.py 🩹

    Fixed: tests/test_expense_tracker.py::TestExpenseTracker::test_categories_is_set_with_default_categories

  • tests/test_expense_tracker.py 🩹

    Fixed: tests/test_expense_tracker.py::TestExpenseTracker::test_remove_category

  • tests/test_investment_tracker.py 🩹

    Fixed: tests/test_investment_tracker.py::TestInvestmentTracker::test_record_transaction

  • tests/test_investment_tracker.py 🩹

    Fixed: tests/test_investment_tracker.py::TestInvestmentTracker::test_register_new_category_empty_string

New Tests:

  • tests/test_alert_manager.py
  • tests/test_investment_tracker.py

🐛 Bug Detection

Potential issues found in the following files:

  • expense_tracker.py

The error occurs because the code in total_expense_by_category only converts the input parameter (category) to lower-case and compares it with the expense entries exactly. However, the expenses added in the test have "category" values in different cases (e.g., "FOOD", "Food") that are not converted to lower-case, so they don't match "food" (the lowercased input). This makes the method only sum the expense that exactly matches "food" in lower-case, resulting in an incorrect sum.

🛠️ Test Results

All 15 tests passed.

☂️ Coverage Improvements

Coverage improvements by file:

  • tests/test_expense_tracker.py

    New coverage: 61.54%
    Improvement: +61.54%

  • tests/test_investment_tracker.py

    New coverage: 57.14%
    Improvement: +57.14%

  • tests/test_alert_manager.py

    New coverage: 100.00%
    Improvement: +100.00%

  • tests/test_investment_tracker.py

    New coverage: 73.81%
    Improvement: +16.67%


Settings | Logs | CodeBeaver

@codebeaver-ai codebeaver-ai deleted a comment from codebeaver-ai bot Feb 3, 2025
@erlapso erlapso changed the title Add python Utils class: Investment and Expenses trackers Pytest - Complete demo Feb 4, 2025
@erlapso erlapso changed the title Pytest - Complete demo Unittest - Complete demo Feb 5, 2025
@erlapso erlapso closed this Feb 26, 2025
@erlapso erlapso reopened this Feb 26, 2025
@erlapso erlapso changed the title Unittest - Complete demo Unit test - Complete demo Feb 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants