summaryrefslogtreecommitdiff
path: root/tests/test_repository.py
Commit message (Collapse)AuthorAgeFilesLines
* tests: fix tests with glib 2.76Christoph Reiter2023-03-241-2/+2
| | | | | | | | | | Fallout from https://gitlab.gnome.org/GNOME/glib/-/commit/0ffe86a1f7e215e4561c3b9f1d03c3cd638ed00f Our test suite runs with G_DEBUG=fatal-criticals and the last glib release upgraded some warnings which we explicitely ignored or captured to criticals, making the tests fail in various places. Ignore those new criticals where needed.
* Remove all Python 2 Python codeChristoph Reiter2020-04-151-5/+1
|
* Merge branch 'wrap-struct-find' into 'master'Christoph Reiter2018-12-151-0/+7
|\ | | | | | | | | pygi-info: wrap g_struct_info_find_method() and g_struct_info_find_field() See merge request GNOME/pygobject!104
| * pygi-info: wrap g_struct_info_find_method() and g_struct_info_find_field()Christoph Reiter2018-12-121-0/+7
| | | | | | | | Because why not.
* | pygi-info: wrap g_union_info_get_alignment()Tomasz Miąsko2018-12-141-0/+1
|/ | | | | Aligment is useful when validating ABI against C. It is already wrapped for structs, wrap it for unions as well.
* test_repository: fix reprecation warnings re collections.abc moveChristoph Reiter2018-11-231-20/+23
| | | | | With newer Python3 one should use collections.abc and not collections for ABC classes.
* tests: improve coverage of girepository wrappersChristoph Reiter2018-03-191-0/+8
|
* tests: Make it possible to use pytest directlywip/creiter/pytest-directChristoph Reiter2018-02-121-5/+3
| | | | | | | | | | | pytest will just import the files passed to it and try to run tests. Since we need to run some setup code convert the tests directory to a Python package and do the initialization in __init__.py. This makes the init code (env vars, typelib search path, dbus) always run when something from the package gets imported. python3 setup.py build_tests # build pygobject and tests py.test-3 tests/test_gi.py # run tests in test_gi.py only
* tests: always call require_version; add TEST_GTK_VERSION env varChristoph Reiter2017-04-021-4/+0
| | | | | | | | Set the versions in runtests.py instead of repeating it in every test module. Add a new TEST_GTK_VERSION env var which defaults to "3.0". Allows to run tests with gtk4 using "make check TEST_GTK_VERSION=4.0"
* tests: Don't skip Regress tests when cairo is missingChristoph Reiter2017-04-021-10/+0
| | | | | | | | Since https://git.gnome.org/browse/pygobject/commit/?id=a731db5908b79b97277be4f5138b46010c2dd616 we build libregress even if cairo is missing. Instead of skipping regress tests when cairo is missing only skip cairo relate tests now.
* Import dependencies when importing typelibs from gi.repositoryChristoph Reiter2015-10-261-0/+10
| | | | | | | | | | | | Recursively import a modules dependencies when importing from gi.repository. This fixes the case where a library depends on initialization code of dependency overrides. For example libwnck expects gdk_init to be called before using its API and gdk_init gets called in the Gdk overrrides. https://bugzilla.gnome.org/show_bug.cgi?id=656314
* Don't emit require_version warning if namespace was loaded previously using ↵Christoph Reiter2015-09-221-0/+11
| | | | | | | | | | | | | | | | | | | g_irepository_require Instead of tracking loaded dependencies ourself to hide warnings if they were loaded by a previous import just look if the namespace was loaded before the import. This (a) makes the implementation much simpler and (b) also takes into account namespaces loaded outside of Python/PyGObject using the libgirepository C API (as is common in applications using libpeas with Python plugins) This also introduces a new Python wrapper for g_irepository_is_registered() to allow checking the loading state of namespaces before imports. This fixes unnecessary require_version warnings in gedit, gnome-builder, totem, rhythmbox etc. https://bugzilla.gnome.org/show_bug.cgi?id=754491
* tests: Silence various error messages and warnings.Christoph Reiter2015-07-021-9/+4
| | | | | | | | | | | | | | This silences glib warnings which are due to testing of error handling, deprecation warnings which we ignore since we want to continue testing deprecated code and other error output of code which is supposed to fail. To reduce code duplication and make things easier this introduces a shared helper module containing various context managers and decorators which allow testing and silencing of warnings and errors. https://bugzilla.gnome.org/show_bug.cgi?id=751156
* tests: Add test for GIRepository.UnionInfo.get_size()Garrett Regier2015-03-011-0/+1
| | | https://bugzilla.gnome.org/show_bug.cgi?id=745362
* Emit ImportWarning when gi.require_version() is not usedChristoph Reiter2015-01-241-0/+10
| | | | | | | | | gi tries to import the latest version of typelibs which can cause existing code to break when a newer typelib is released. Emit an ImportWarning when gi.require_version() is not used to give developers this awareness so they can future proof their code. https://bugzilla.gnome.org/show_bug.cgi?id=727379
* Python 3.4 make check fixesSimon Feltman2014-05-261-2/+0
| | | | | | | | | Bump GI required version to 1.39.0. This is needed to get rid of expectedFailures which pass when built with 1.39.0 (unexpected successes fail unittesting in Python 3.4). Silence deprecation warning when using imp.reload. https://bugzilla.gnome.org/show_bug.cgi?id=730411
* Add gi.CallableInfo.can_throw_gerror()Simon Feltman2014-05-031-0/+16
| | | | Add static binding for g_callable_info_can_throw_gerror.
* Derive PyCallbackInfo from PyCallableInfoSimon Feltman2014-05-031-0/+7
| | | | | | Update the static GI bindings for PyGICallbackInfo to derive from PyGICallableInfo. This makes all the gi.CallableInfo methods available to gi.CallbackInfo for use from Python.
* Support union creation with PyGIStructSimon Feltman2014-01-041-0/+13
| | | | | | Add additional case for allowing the creation bare unions wrapped with PyGIStruct. This is needed because PyGIStruct wraps both GIStruct and GIUnion types.
* docs: Move GIArgInfo.get_pytype_hint into gi.docstringSimon Feltman2013-12-311-1/+0
| | | | | | | | | Move the C implementation of pytype hinting into pure Python. Now that doc strings are lazily evaluated we can simplify this tedious bit of C code with Python. This is precursory work for getting return types into function doc strings. https://bugzilla.gnome.org/show_bug.cgi?id=697356
* Add missing methods on PyGIBaseInfo and sub-classesSimon Feltman2013-10-071-0/+134
| | | | | | Expose all methods of GIBaseBase info and its sub-classes. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Expose all GI enum and flags typesSimon Feltman2013-10-071-1/+12
| | | | | | | | | | Add new types for GIDirection, GITransfer, GIArrayType, GIScopeType, GIVFuncInfoFlags, GIFieldInfoFlags, GIFuncitonInfoFlags, GITypeTag, and GInfoType. These types are found in the gi._gi module exposed without the "GI" prefix and contain all of their values as class attributes. e.g. gi._gi.Transfer.EVERYTHING. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Add GIBaseInfo.equal methodSimon Feltman2013-10-071-0/+1
| | | | | | | | Break PyGIBaseInfo rich compare into two methods: equal and richcompare. Equal is a direct exposure of the GI method and richcompare makes use of this with additional support for Pyton "==" and "!=" operators. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Move existing repository tests into test_repositorySimon Feltman2013-10-041-0/+28
| | | | | | | Move flags and enum double registration tests into test_repository.py. Remove duplicate ObjectInfo tests from test_gi.py. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Add unittests for GIRepositorySimon Feltman2013-10-041-0/+170
Add basic unittests for the existing classes and methods exposed for the GIRepository module (gi._gi). https://bugzilla.gnome.org/show_bug.cgi?id=709008