# issue with dbt test not being recognized

**URL:** <https://discourse.getdbt.com/t/issue-with-dbt-test-not-being-recognized/11273>\
**Category:** Help\
**Created:** [December 20, 2023, 6:56pm UTC](https://discourse.getdbt.com/t/issue-with-dbt-test-not-being-recognized/11273 "2023-12-20T18:56:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![audessy](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@audessy](https://discourse.getdbt.com/u/audessy)\
**Post date:** [December 20, 2023, 6:56pm UTC](https://discourse.getdbt.com/t/issue-with-dbt-test-not-being-recognized/11273/1 "2023-12-20T18:56:27Z")

</div>

## I am persistently getting an undefined error for my generic test:

I have written a generic test in dbt: is\_postive.sql

```auto
{% test is_postive(model, column_name) %}

select 
    {{ column_name }}
from {{ model }} 
where {{ column_name }} < 0

{% endtest %}

```

This test is located in the tests/generic folder in my dbt project. The dbt project yaml file sets the tests location to this folder `test-paths: ["tests"]`

I am trying to reference this test in a yaml file for a model:

```auto
models:
  - name: fct__monthly_revenue
    tests:
      - unique:
          column_name: "id || '-' || date"
    config:
      schema: analytics
    columns: 
      - name: revenue
        tests:
          - is_positive:
              severity: warn

```

however, when I try to build the model I get this error:

```auto
Compilation Error in test is_positive_fct__monthly_revenue_revenue (models/analytics/fpaa/fpaa_revenue.yml)
  'test_is_positive' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps".

```

## Some things I have tried already:

- changing the file name to test\_is\_positive.sql
- originally had the test directly in the test folder instead of the generic sub-folder
- putting config in my yaml file a la:

```auto
    columns: 
      - name: revenue
        tests:
          - is_positive:
              config:
                severity: warn

```

I could use the accepted range from dbt\_utils but I’d like to build more custom generic tests and so I’m trying to get a relatively simple one to work first

---

<div class="post-metadata">

**Author:** ![alyk](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/alyk/32/3347_2.png) [@alyk](https://discourse.getdbt.com/u/alyk)\
**Post date:** [December 21, 2023, 8:29pm UTC](https://discourse.getdbt.com/t/issue-with-dbt-test-not-being-recognized/11273/3 "2023-12-21T20:29:00Z")

</div>

hm. your test name is `is_postive`  
the thing you’re trying to call in your yml is is\_positive:

```auto
tests:
     - is_positive:
           severity: warn

```

---

<div class="post-metadata">

**Author:** ![audessy](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@audessy](https://discourse.getdbt.com/u/audessy)\
**Post date:** [December 21, 2023, 10:24pm UTC](https://discourse.getdbt.com/t/issue-with-dbt-test-not-being-recognized/11273/4 "2023-12-21T22:24:17Z")

</div>

oh my god 🤦‍♀️, thank you!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)\
**Post date:** [December 28, 2023, 10:25pm UTC](https://discourse.getdbt.com/t/issue-with-dbt-test-not-being-recognized/11273/5 "2023-12-28T22:25:19Z")

</div>

Closed on December 28, 2023, 10:25pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
