• sugar_in_your_tea@sh.itjust.works
    link
    fedilink
    arrow-up
    2
    ·
    7 months ago

    No, but we haven’t really been trying.

    Our tests are written in unittest style, but run with unit test. Unfortunately, a large number of our tests rely on fixtures, as in loading a ton of data into a SQLite database and then running code against that. That’s because we have DB queries all throughout our service logic, so it’s quite a bit of spaghetti to try to mock the DB logic.

    So instead of trying to fix the memory issues in pytest, we’re refactoring our app to separate the DB calls from our service logic, which should let us easily mock the repository in our tests.

    So short answer: no. Longer answer: I might be able to tell you in a few months if this approach fixes the issue.