Repository: dbt-labs/dbt-core

Issue:
[Wilt Chamberlain] Add severity configs to custom data tests
## Feature

### Feature description
This is a nice-to-have if it's easy to implement. Custom data tests should be configurable with a `severity` as with schema tests.

I'm imagining:
```
{{ config(severity='warn') }}

select ...
```

Though I'm not certain how configs work with custom data tests currently. If this is involved, then we should do it in a future release.

### Who will this benefit?
custom data test users


Discussion:
This actually already works if you do:

```
{{ config(severity='WARN') }}
```

But dbt is very particular about the casing. Is that all you want me to do, fix that?
yes! That's awesome :)

Sure, if you don't mind making it case-insensitive and adding a test, then I think we can call this one a Feature 🌟 

Resolving patch:
diff --git a/core/dbt/main.py b/core/dbt/main.py
--- a/core/dbt/main.py
+++ b/core/dbt/main.py
@@ -380,11 +380,13 @@ def _build_docs_generate_subparser(subparsers, base_subparser):
     return generate_sub
 
 
-def _add_selection_arguments(*subparsers):
+def _add_selection_arguments(*subparsers, **kwargs):
+    models_name = kwargs.get('models_name', 'models')
     for sub in subparsers:
         sub.add_argument(
-            '-m',
-            '--models',
+            '-{}'.format(models_name[0]),
+            '--{}'.format(models_name),
+            dest='models',
             required=False,
             nargs='+',
             help="""
@@ -722,7 +724,8 @@ def parse_args(args):
                           rpc_sub)
     # --models, --exclude
     _add_selection_arguments(run_sub, compile_sub, generate_sub, test_sub,
-                             archive_sub, snapshot_sub)
+                             archive_sub)
+    _add_selection_arguments(snapshot_sub, models_name='select')
     # --full-refresh
     _add_table_mutability_arguments(run_sub, compile_sub)
 


Test patch:
diff --git a/test/integration/004_simple_snapshot_test/test_simple_snapshot.py b/test/integration/004_simple_snapshot_test/test_simple_snapshot.py
--- a/test/integration/004_simple_snapshot_test/test_simple_snapshot.py
+++ b/test/integration/004_simple_snapshot_test/test_simple_snapshot.py
@@ -151,7 +151,7 @@ def test__postgres_exclude_snapshots(self):
     @use_profile('postgres')
     def test__postgres_select_snapshots(self):
         self.run_sql_file('seed_pg.sql')
-        results = self.run_dbt(['snapshot', '--models', 'snapshot_castillo'])
+        results = self.run_dbt(['snapshot', '--select', 'snapshot_castillo'])
         self.assertEqual(len(results),  1)
         self.assertTablesEqual('snapshot_castillo', 'snapshot_castillo_expected')
         self.assertTableDoesNotExist('snapshot_alvarez')
@@ -425,7 +425,7 @@ def test__bigquery__snapshot_with_new_field(self):
         # this should fail because `check="all"` will try to compare the nested field
         self.run_dbt(['snapshot'], expect_pass=False)
 
-        self.run_dbt(["snapshot", '-m', 'snapshot_actual'])
+        self.run_dbt(["snapshot", '--select', 'snapshot_actual'])
 
         # A more thorough test would assert that snapshotted == expected, but BigQuery does not support the
         # "EXCEPT DISTINCT" operator on nested fields! Instead, just check that schemas are congruent.