Skip to content

FR: Support for unit-testing macros #123

@darist

Description

@darist

dbt-unit-testing is great for unit-testing models.

This is a proposal to extend dbt-unit-testing so it can become great for unit-testing macros as well.

Concrete examples (and a few alternatives) are presented in #122 (currently in draft). Looking for some feedback:

  1. Do you think this belongs within the scope of dbt-unit-testing, or should it be a separate package?
  2. Do you see a way where we could have a single test() macro that supports both model tests and macro tests, or should we keep two separate macros test() and macro_test()?
  3. What are your opinions between macro_test() and macro_test_with_t()? Do you find t useful? is the syntax too confusing?
  4. Do you know of a way that we can test and expect an exception to be raised (like python unittest's assertRaises)?
  5. Naming is hard. If you can think of better names for the macros, please let me know.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions