diff --git a/unittests/test_yaml_model_parser.py b/unittests/test_yaml_model_parser.py index 1019a93a0aa4292cea75fe8fba57e19e55359baa..a7f6d6b9b292a6dc064e6fa35682c40bd66c07d2 100644 --- a/unittests/test_yaml_model_parser.py +++ b/unittests/test_yaml_model_parser.py @@ -19,7 +19,7 @@ import unittest from datetime import date from tempfile import NamedTemporaryFile -from pytest import deprecated_call, raises, mark +from pytest import raises, mark import linkahead as db from caosadvancedtools.models.parser import (TwiceDefinedException, @@ -527,7 +527,7 @@ F: def test_issue_36(): - """Test whether the `parent` keyword is deprecated. + """Test whether the `parent` keyword is removed. See https://gitlab.com/caosdb/caosdb-advanced-user-tools/-/issues/36. @@ -550,17 +550,12 @@ R3: inherit_from_obligatory: - R1 """ - with deprecated_call(): - # Check whether this is actually deprecated + with raises(ValueError) as ve: + # The keyword has been removed, so it should raise a regular ValueError. model = parse_model_from_string(model_string) - assert "R3" in model - r3 = model["R3"] - assert isinstance(r3, db.RecordType) - for par in ["R1", "R2"]: - # Until removal, both do the same - assert has_parent(r3, par) - assert r3.get_parent(par)._flags["inheritance"] == db.OBLIGATORY + assert "invalid keyword" in str(ve.value) + assert "parent" in str(ve.value) def test_yaml_error():