def test_gi2_repository(pyi_builder, repository_name):
'''
Test the importability of the `gi.repository` subpackage with the passed
name installed with PyGObject >= 2.0 (e.g., `GLib`, corresponding to the
`gi.repository.GLib` subpackage).
'''
# Test the importability of this subpackage.
pyi_builder.test_source('''
import gi
gi.require_version('{repository_name}', '2.0')
from gi.repository import {repository_name}
print({repository_name})
'''.format(repository_name=repository_name))
评论列表
文章目录