From b31b4f29f8564795e3189459bcc71fb3ee86237a Mon Sep 17 00:00:00 2001 From: Greg Back Date: Fri, 29 Sep 2017 18:45:15 +0000 Subject: [PATCH] Handle inconsistent error messages between Python 2 and Python 3. --- stix2/test/test_data_sources.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stix2/test/test_data_sources.py b/stix2/test/test_data_sources.py index a65b6ec..e34d603 100644 --- a/stix2/test/test_data_sources.py +++ b/stix2/test/test_data_sources.py @@ -220,7 +220,9 @@ def test_add_get_remove_filter(ds): with pytest.raises(TypeError) as excinfo: # create Filter that has a value type that is not allowed Filter('created', '=', object()) - assert str(excinfo.value) == "Filter value type '' is not supported. The type must be a python immutable type or dictionary" + # On Python 2, the type of object() is `` On Python 3, it's ``. + assert str(excinfo.value).startswith("Filter value type") + assert str(excinfo.value).endswith("is not supported. The type must be a python immutable type or dictionary") assert len(ds.filters) == 0