def test_get_config_invalid_file_with_array_as_top_level_element() -> None:
    """An exception should be raised if top-level element is array."""
    expected_error_msg = (
        'Top-level element of YAML file '
        'tests/test-config/invalid-config-w-array.yaml should be an object.'
    )
    with pytest.raises(InvalidConfiguration) as exc_info:
        config.get_config('tests/test-config/invalid-config-w-array.yaml')
    assert expected_error_msg in str(exc_info.value)
An exception should be raised if top-level element is array.
tests/test_get_config.py