@@ -281,27 +281,8 @@ def test_ROSE_ORIG_HOST_replacement_behaviour(
281281 assert node ['env' ]['ROSE_ORIG_HOST' ].value == 'IMPLAUSIBLE_HOST_NAME'
282282
283283
284- @pytest .mark .parametrize (
285- 'compat_mode, must_include, must_exclude' ,
286- (
287- (True , None , 'Use [template variables]' ),
288- (True , 'root-dir' , None ),
289- (False , 'Use [template variables]' , None ),
290- (False , 'root-dir' , None ),
291- )
292- )
293- def test_deprecation_warnings (
294- caplog , monkeypatch , compat_mode , must_include , must_exclude
295- ):
296- """Method logs warnings correctly.
297-
298- Two node items are set:
299-
300- * ``jinja2:suite.rc`` should not cause a warning in compatibility mode.
301- * ``root-dir=/somewhere`` should always lead to a warning being logged.
302-
303- Error messages about
304- """
284+ def test_deprecation_warnings (caplog ):
285+ """It should warn over deprecated Rose config sections."""
305286 # Create a node to pass to the method
306287 # (It's not a tree test because we can use a simpleNamespace in place of
307288 # a tree object):
@@ -310,16 +291,13 @@ def test_deprecation_warnings(
310291 node .set (['root-dir' , '~foo' ])
311292 tree = SimpleNamespace (node = node )
312293
313- # Patch compatibility mode flag and run the function under test:
314- monkeypatch .setattr ('cylc.rose.utilities.cylc7_back_compat' , compat_mode )
315294 deprecation_warnings (tree )
316295
317296 # Check that warnings have/not been logged:
318- records = '\n ' .join ([i .message for i in caplog .records ])
319- if must_include :
320- assert must_include in records
321- else :
322- assert must_exclude not in records
297+ records = '\n ' .join (i .message for i in caplog .records )
298+
299+ assert 'root-dir' in records
300+ assert 'Use [template variables]' in records
323301
324302
325303@pytest .mark .parametrize (
0 commit comments