hamilton icon indicating copy to clipboard operation
hamilton copied to clipboard

Auto generate pytest unit test stubs for hamilton functions

Open skrawcz opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. We should be able to bootstrap a unit test suite given a hamilton function module.

Most DS probably write functions first, and then think about tests. We should make bootstrapping unit tests easy.

Describe the solution you'd like

  1. User writes Hamilton functions.
  2. User uses a command line utility to generate pytest unit test stubs for a module. feature_logic.py --> test_feature_logic.py
  3. Within that module, then we should be able to determine which functions have tests and which do not, creating the test for them appropriately def my_feature() --> def test_my_feature().
  4. To start we probably don't want too many options -- perhaps a --dry-run argument that would list what would be created.

Describe alternatives you've considered Not doing this.

Additional context This would help the software engineering best practices story. We could similarly use this approach to bulk add check_output decorators.

skrawcz avatar Jul 20 '22 21:07 skrawcz