Create sub module with atom name

It’s not a part of public API and therefore no answer guarantees you a working solution using it. Why cant you use %module{…} notation?

First of all why you do this? Much more common is to place it in test/fixtures/my_fixture.ex file …

There was some talk about this issue … I think it was about Elixir scripts i.e. exs files called like elixir my_script.exs. There was a question I think about ecto’s macros not working on same level where module is defined, but working inside some function … Somebody from Elixir’s core team (most probably José Valim) commented it and that it’s known limitation.