How does Application.put_env(:ecto, :async_integration_tests, boolean) work?

I’ve seen this in Ecto integration tests, but it does not have any config/config file and I did not find anything related to it in the Ecto or ExUnit repository.

Another question is where the Ecto.Integration.Case module is defined.

1 Like

Application.put_env/3 is basically the same as using a config file. It will put some key:value combination into that applications environment so that it can be accessed later. It is just a way for the adapters to be able to tell Ecto whether or not it is safe to run the tests in async mode.

Ecto.Integration.Case is defined within each adapters code base. Here are the ones for postgres, mysql and mongodb.

1 Like