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