Add a tag to a whole module for the purpose of testing

I know I can add tags to restrict tests to tests with a certain tag. Is there a way to tag a whole module and do similar?

Perhaps you’re looking for @moduletag? See ExUnit.Case – ExUnit v1.2.1

3 Likes

For the sake of completion: In addition to what @kip said, there’s also @describetag for tagging describe blocks.

So there are tags for each layer:

  • @moduletag for tagging whole modules

  • @describetag for tagging describe blocks

  • @tag for tagging individual tests

4 Likes