'Make sure fix_harfbuzz warns when QtWidgets is imported.'

@pytest.mark.parametrize('frozen,    level', [(True, logging.DEBUG), (False, logging.WARNING)])
def test_widgets_warning(self, args, monkeypatch, caplog, frozen, level):

    from PyQt5 import QtWidgets
    if frozen:
        monkeypatch.setattr(earlyinit.sys, 'frozen', True, raising=False)
    else:
        monkeypatch.delattr(earlyinit.sys, 'frozen', raising=False)
    with caplog.at_level(level):
        earlyinit.fix_harfbuzz(args)
    record = caplog.records[0]
    assert (record.levelno == level)
    msg = 'Harfbuzz    fix    attempted    but    QtWidgets    is    already    imported!'
    assert (record.message == msg)
