def test_check_version_singleton(caplog):
    """Tests that minor version difference logging is only logged once."""
    # Run test_check_version twice which will assert that the warning is only logged
    # once.
    for x in range(2):
        test_check_version(
            '2.0.0',
            '1.0.0',
            logging.WARNING,
            'This could cause failure to authenticate',
            caplog,
        )
    # Run it again with a different singleuser_version to make sure that is logged as
    # a warning.
    caplog.clear()
    test_check_version(
        '2.0.0',
        '1.1.0',
        logging.WARNING,
        'This could cause failure to authenticate',
        caplog,
    )
Tests that minor version difference logging is only logged once.
jupyterhub/tests/test_version.py