Skip to content

Commit

Permalink
better warnings handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Jan 27, 2019
1 parent 34cdd84 commit 63c0752
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ codestyle_ignore =
codestyle_exclude =
docs/conf.py
rasa_core/policies/tf_utils.py

filterwarnings =
ignore::ResourceWarning:httpretty
[metadata]
description-file = README.md
license_file = LICENSE.txt
2 changes: 2 additions & 0 deletions tests/test_evaluation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import pytest

from rasa_core import evaluate
from rasa_core.agent import Agent
Expand Down Expand Up @@ -58,6 +59,7 @@ async def test_end_to_end_evaluation_script(tmpdir, default_agent):
assert num_stories == 2


@pytest.mark.filterwarnings("ignore:Precision and F-score are ill-defined")
async def test_end_to_end_evaluation_script_unknown_entity(tmpdir,
default_agent):
completed_trackers = await evaluate._generate_trackers(
Expand Down
9 changes: 5 additions & 4 deletions tests/test_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ def test_prediction_on_empty_tracker(self, trained_policy, default_domain):
assert min(probabilities) >= 0.0

def test_persist_and_load_empty_policy(self, tmpdir):
empty_policy = self.create_policy(None)
empty_policy.persist(tmpdir.strpath)
loaded = empty_policy.__class__.load(tmpdir.strpath)
assert loaded is not None
with pytest.warns(UserWarning):
empty_policy = self.create_policy(None)
empty_policy.persist(tmpdir.strpath)
loaded = empty_policy.__class__.load(tmpdir.strpath)
assert loaded is not None


class TestKerasPolicy(PolicyTestCollection):
Expand Down

0 comments on commit 63c0752

Please sign in to comment.