From 3c7cb1cc39bc00631afffbbe3f4903b225d867eb Mon Sep 17 00:00:00 2001
From: Florian Spreckelsen <f.spreckelsen@indiscale.com>
Date: Tue, 6 Feb 2024 14:23:44 +0100
Subject: [PATCH] TST: Adapt unittest to removed parent keyword

---
 unittests/test_yaml_model_parser.py | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/unittests/test_yaml_model_parser.py b/unittests/test_yaml_model_parser.py
index 1019a93a..a7f6d6b9 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():
-- 
GitLab