def test_no_duplicates_multiple_instances(manager_nospawn, minimal_conf_noscreen, backend_name):
    """Check only one instance of Systray widget."""
    if backend_name == "wayland":
        pytest.skip("Skipping test on Wayland.")

    assert not widget.Systray._instances
    config = minimal_conf_noscreen
    config.screens = [
        libqtile.config.Screen(top=libqtile.bar.Bar([widget.Systray(), widget.Systray()], 10))
    ]

    manager_nospawn.start(config)

    widgets = manager_nospawn.c.bar["top"].info()["widgets"]
    assert len(widgets) == 2
    assert widgets[1]["name"] == "configerrorwidget"
Check only one instance of Systray widget.
test/widgets/test_systray.py