I noticed that my tests take around 30s of startup time before even executive the first test function. then i use the --reuse-db command which reduces the start-up time to 1-2 second. this shows that since I have lot of migrations.. may be that was causing the high startup time. I want to know other developers approach on this. how do you test a project which have lot of migrations.
p.s. I am using pytest with fake library & postgres as DB
#Speed Up Tests Setup Start-up time
4 messages · Page 1 of 1 (latest)
I found Adam Johnson's book invaluable for this topic: https://adamj.eu/tech/2020/05/04/new-book-speed-up-your-django-tests/
thanks for sharing this. I will check it out. but meanwhile i want to know how other developers do testing where there are lot of migrations. at the time of writing testcases, I have to run them many times and since every time it takes ~30 sec.. it's distracting.
You already identified the main solution, --reuse-db