Test fixtures not available in seeds.exs?

I figured I’d consolidate my Schema attribute functions into one place (they were in two places before, in fixtures and in seeds.exs). I consolidated into the fixture modules and used them in seeds.exs. Except, if I try ecto.reset, it complains about the fixture modules not being defined.

I’ve done my best to isolate the problem, but the best explanation I can come up with is that the seeds.exs file simply can’t use the fixture modules for some reason. Am I correct? And if so, is there a way around this?

Where are your fixture modules located?

If they are not under lib/ and you didn’t change your elixirc_paths or required them in your seeds.exs they probably weren’t compiled.

1 Like

Hi! I have this at the top of seeds.exs:

Code.require_file("spec/support/test_helpers.ex")