def test_setting_root_attribute_that_masks_existing_causes_warning(self):
        # pylint: disable=protected-access
        warns = []

        def catch_warning(*args, **kwargs):
            warns.append(args[0])

        old_showwarning = warnings.showwarning
        warnings.showwarning = catch_warning

        with self.context.use_with_user_mode():
            self.context._push()
            self.context.thing = "teak"
        self.context._set_root_attribute("thing", "oak")

        warnings.showwarning = old_showwarning

        print(repr(warns))
        assert warns
        warning = warns[0]
        assert isinstance(warning, runner.ContextMaskWarning)
        info = warning.args[0]
        assert info.startswith("behave runner"), "%r doesn't start with 'behave runner'" % info
        assert "'thing'" in info, "%r not in %r" % ("'thing'", info)
        filename = __file__.rsplit(".", 1)[0]
        if python_implementation() == "Jython":
            filename = filename.replace("$py", ".py")
        assert filename in info, (filename, info) % "%r not in %r"
dataset/ETHPy150Open behave/behave/test/test_runner.py/TestContext.test_setting_root_attribute_that_masks_existing_causes_warning/swapped operands of `%`