Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Support for unit-testing macros #123

Open
darist opened this issue Mar 9, 2023 · 1 comment
Open

FR: Support for unit-testing macros #123

darist opened this issue Mar 9, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@darist
Copy link
Contributor

darist commented Mar 9, 2023

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!

@cdiniz
Copy link
Collaborator

cdiniz commented Apr 15, 2024

is this suggestion viable? #157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants