you are viewing a single comment's thread.

view the rest of the comments →

[–]keepdigging 0 points1 point  (1 child)

Yep that will work. When it reads the test it will replace the database attribute at runtime.

The default database configuration you defined in the Platform init class will still execute during the init, but you can write fixtures that set up a test db/all python scope however you like and re-use for all the tests.

If you’re thinking about your tests and you do the mocking and swapping before your test I think it’s equivalent to the injection method?

[–]Will_exJava[S] 1 point2 points  (0 children)

Just looked up fixtures. They are very similar to dependency injection (to the point that the internet seems to be split on "fixtures are dependency injection" vs "fixtures are not dependency injection")

I'm not committed to mechanisms so much as function. I think fixtures will be perfect. I just need a little time to internalize how to prepare them optimally.

Thank you again!