AnsonDev42 / balance-checker-bot

Check your balance in Monzo Bank before your direct debit day
GNU General Public License v3.0
2 stars 0 forks source link

test: resolve the monkey-mock not overwriting the BCB_Setting() object #13

Open AnsonDev42 opened 8 months ago

AnsonDev42 commented 8 months ago
@pytest.fixture(autouse=True)
def mock_settings(monkeypatch):

this does not work for now on other test functions, for now the temp fix is reimport and call the function in all test functions again

    from balance_checker_bot.config import get_settings
    get_settings()

Might because how the FastAPI test client firstly register this function so that it's not modified?

AnsonDev42 commented 8 months ago

or just modify the BCB_Settings as the singleton? (for now uses LRU