diff --git a/glue/core/data_factories/tests/test_pandas.py b/glue/core/data_factories/tests/test_pandas.py index 815be02d5..57c4d9aea 100644 --- a/glue/core/data_factories/tests/test_pandas.py +++ b/glue/core/data_factories/tests/test_pandas.py @@ -45,8 +45,8 @@ def test_translator_from_data(): with pytest.raises(ValueError) as exc: df = data.get_object() - assert exc.value.args[0] == ('Specify the object class to use with cls= - supported ' - 'classes are:\n\n* pandas.core.frame.DataFrame') + # Do not specify full error message in case plugins add new translations + assert 'Specify the object class to use with cls' in exc.value.args[0] df = data.get_object(cls=DataFrame) assert_equal(list(df.columns), ['a', 'b', 'c']) diff --git a/glue/core/tests/test_data_translation.py b/glue/core/tests/test_data_translation.py index 2956cb843..01e95e77b 100644 --- a/glue/core/tests/test_data_translation.py +++ b/glue/core/tests/test_data_translation.py @@ -112,9 +112,8 @@ def test_get_object_explicit_class(self): with pytest.raises(ValueError) as exc: data.get_object() - assert exc.value.args[0] == ('Specify the object class to use with cls= - ' - 'supported classes are:\n\n* pandas.core.frame.DataFrame\n' - '* glue.core.tests.test_data_translation.FakeDataObject') + assert 'Specify the object class to use with cls' in exc.value.args[0] + assert 'glue.core.tests.test_data_translation.FakeDataObject' in exc.value.args[0] obj = data.get_object(cls=FakeDataObject) assert isinstance(obj, FakeDataObject) @@ -142,9 +141,8 @@ def test_get_subset_object_explicit_class(self): with pytest.raises(ValueError) as exc: data.get_subset_object() - assert exc.value.args[0] == ('Specify the object class to use with cls= - ' - 'supported classes are:\n\n* pandas.core.frame.DataFrame\n' - '* glue.core.tests.test_data_translation.FakeDataObject') + assert 'Specify the object class to use with cls' in exc.value.args[0] + assert 'glue.core.tests.test_data_translation.FakeDataObject' in exc.value.args[0] subset = data.get_subset_object(subset_id=0, cls=FakeDataObject)