Skip to content

Commit

Permalink
Silence warnings about not having a config option
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Jan 6, 2024
1 parent 374d6d6 commit 42614ec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import os
import shutil
import warnings
from unittest import mock

import click
Expand Down Expand Up @@ -129,6 +130,15 @@ def mlflow_uri(tmp_path):
mlflow.end_run()


@pytest.fixture(scope="function", autouse=True)
def config_warning_fixture():
# morpheus.cli.utils._apply_to_config method will warn about any keyword arguments that don't match a config option
# this isn't triggered in normal production code, but is triggered in the cli tests.
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="No config option matches for.*", category=UserWarning)
yield


@pytest.mark.reload_modules(commands)
@pytest.mark.usefixtures("chdir_tmpdir", "reload_modules")
@pytest.mark.use_python
Expand Down

0 comments on commit 42614ec

Please sign in to comment.