Skip to content

No error message from test w/o household and SPM info #407

@nmrodelo

Description

@nmrodelo

When working on #315, I discovered that tests missing household and SPM info will run, but if the output they are testing needs to use the size of the household in its calculation, an error message with completely different info is thrown. Not urgent, but good to know, as I imagine we'll run into this again as we add more and more tests.

@nikhilwoodruff

This code:

- name: Family of 3
  period: 2022
  absolute_error_margin: 0.01
  input:
    people:
      person_1:
        age: 30
      person_2:
        age: 50
      person_3:
        age: 35
  output:
    # Ineligible as a family of 3.
    snap_minimum_benefit: 0

Throws this error:

Test 'Family of 3':
    snap_minimum_benefit@2022: [195.84 195.84 195.84] differs from 0.0 with an absolute margin [195.84 195.84 195.84] > 0.01

The proper code looks like this:

- name: Family of 3
  period: 2022
  absolute_error_margin: 0.01
  input:
    people:
      person_1:
        age: 30
      person_2:
        age: 50
      person_3:
        age: 35
    spm_units:
      spm_unit:
        members: [person_1, person_2, person_3]
    households:
      household:
        state_group: CONTIGUOUS_US
  output:
    # Ineligible as a family of 3.
    snap_minimum_benefit: 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions