summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add (in)equality tests for Gdk.{Color,RGBA}Mazhar Hussain2023-03-281-0/+8
|
* tests: fix tests with glib 2.76Christoph Reiter2023-03-243-4/+4
| | | | | | | | | | 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.
* tests: Support CPython 3.8 on WindowsChristoph Reiter2022-04-091-0/+16
| | | | | | | | | | | | Python 3.8 no longer uses PATH for searching DLLs so we have to add them manually. Note that unlike PATH add_dll_directory() has no defined order, so if there are two same DLLs in PATH we might get a random one. This only makes sure that 'setup.py test' and 'pytest' continue working. If you include pygobject manually you have to call os.add_dll_directory() yourself with the location of the DLLs you ship.
* tests: Remove PyPy fixme that appears to be workingBenjamin Berg2022-03-281-1/+0
| | | | | The test_gvalue_gobject_ref_counts appears to be working just fine these days.
* gi: Fix GArray length calculation for other item sizesBenjamin Berg2022-03-281-1/+0
|
* Instead of printing an error, raise an exceptionArjan Molenaar2022-03-281-0/+8
|
* Do not override Treeview.enable_model_drag_xx for GTK4Arjan Molenaar2022-03-271-1/+14
| | | | Those methods require a Gdk.ContentFormats object.
* Fix some broken links to the PyPy bug trackerChristoph Reiter2022-03-272-2/+2
| | | | They moved away from bitbucket some time ago.
* tests: disable fatal-warnings fatal-criticals on WindowsChristoph Reiter2022-03-271-2/+4
| | | | | | If it triggers it creates a blocking GUI dialog without any helpful output. I can't reproduce the cause on my local machine, just on the CI server, so jsut disable this for now.
* gtk overrides: restore Gtk.ListStore.insert_with_valuesv with newer gtk4Christoph Reiter2021-09-192-2/+17
| | | | | | | | It got renamed in gtk 4.1.0, see https://gitlab.gnome.org/GNOME/gtk/-/commit/a1216599ff6b39bca3e936fbf To avoid an API break and make porting easier provide both versions for all users. Fixes #467
* tests: silence a deprecation warning with newer glibChristoph Reiter2021-09-191-2/+4
|
* Fix a couple of memory leaks in the testsDavid King2021-08-231-2/+4
| | | | | | Found by Coverity. https://bugzilla.redhat.com/show_bug.cgi?id=1938851
* Expose GObject.Object.run_dispose()Christoph Reiter2021-04-271-0/+19
| | | | | | | | | | Up until now this raised an exception "This method is currently unsupported.". With Gtk.Widget.destroy() gone in gtk4 and that method often being used to remove references to other objects and breaking cycles this is the next best thing on a lower level and should make porting a bit easier. Fixes #470
* Fix regression in marshalling partial() objectsChristoph Reiter2021-03-301-0/+16
| | | | | | | | | | | | In a4880dbc4575fadc0e3 a special case for partial() was added to handle gtk4 template callbacks. This in turn broken normal usage of partial objects. To work around that add a special marker in the gtk template code for now until we find a better fix. Also adds a test so this doesn't happen again. Fixes #464
* tests: fix test with glib 2.68 re GLocalFileChristoph Reiter2021-03-301-1/+1
| | | | | | | Since 2.68 Gio.File.new_for_path("") returns a GDummyFile instead of a GLocalFile. We don't really care since we just want to test that there is a name despite the type not being in the gir, so just pass a potentially valid path instead.
* tests: Re-enable template tests for gtk4wip/jfelder/template-gtk4Jean Felder2020-12-061-3/+0
|
* tests: Do not use container api when gtk4 is usedJean Felder2020-12-061-6/+35
| | | | | GTK4 removed the Gtk.Container interface. All GTK4 widgets are now iterable.
* tests: Do not use the margin property for template testsJean Felder2020-12-061-4/+4
| | | | | In GTK4, the margin property does not exist anymore. Replace it by the margin-top property.
* tests: Update builer tests to work with gtk4Jean Felder2020-12-061-21/+38
|
* tests: Do not swap signal when object is setJean Felder2020-12-061-2/+2
| | | | Swapped defaults to TRUE when object is set.
* gtk: Add override for Gtk.CustomSorter.set_sort_funcJean Felder2020-12-061-1/+94
| | | | | | | | | | This function use CompareDataFunc which works with pointers and doesn't know anything about GObjects. The same logic as in Gio.List.sort and Gio.List.insert_sorted is used. An associated unit_test is also added.
* gtk overrides: Make GTK4 widgets iterableJean Felder2020-11-211-0/+31
| | | | | | | | | | GTK4 removed the Gtk.Container interface, and added API on Gtk.Widget to iterate over children instead. Making Widgets iterable allows to easily loop over the children and check is a widget is a child of an other one. A new test is also added.
* overrides: Remove various overrides for gtk4ebassi/gtk4-overridesChristoph Reiter2020-11-151-12/+16
| | | | | | Basically everything where we hav a transition path that works for both gtk3 and 4. We'll need to add new deprecation warnings for gtk3 once things have settled down.
* Clean up Widget overridesChristoph Reiter2020-11-151-1/+13
|
* tests: various fixes for gtk4Christoph Reiter2020-11-152-27/+56
| | | | skip template/builder tests for now as they require larger changes
* gtk4: Skip template test for nowChristoph Reiter2020-11-151-1/+4
| | | | We'll get back to them later
* gtk4: Remove overrides for PanedChristoph Reiter2020-11-151-0/+1
| | | | pack1/2 are gone
* tests: Work around a crash in the new gtk4 a11y stackChristoph Reiter2020-11-151-0/+4
| | | | | | | gtk4 calls get_dbus_object_path() on the default app and glib leaves invalid GApplication instances as default in various places. It's hard to track where a new default instances gets set, so just disable a11y in the test suite for now.
* tests: fix tests with glib masterChristoph Reiter2020-11-151-1/+2
| | | | | GFileIcon asserts that it gets a file now: https://gitlab.gnome.org/GNOME/glib/-/commit/e2fbb74301
* tests: Remove usage of some deprecated unittest methodsChristoph Reiter2020-11-076-51/+47
|
* tests: remove an old libtool search pathChristoph Reiter2020-11-071-1/+0
|
* tests: Remove metapath hack to import when uninstalledChristoph Reiter2020-11-071-23/+0
| | | | | | | This was required for Python 2 where Python didn't import our built modules in the build dir because there is no __init__.py. In Python 3 this just works. Tested with setup.py/pytest/meson
* gtk overrides: Remove Container use for GTK4wip/mschraal/gtk4-container-removalMarinus Schraal2020-10-071-6/+18
|
* Replace PyUnicode_GET_SIZE() usage with PyUnicode_GET_LENGTH()Christoph Reiter2020-10-061-0/+1
| | | | | | | PyUnicode_GET_SIZE() is deprecated and actually wrong in case wchar_t is not 4 bytes and high code points, use PyUnicode_GET_LENGTH() instead. Fixes a deprecation warning with Python 3.9
* meson: Make the `pycairo` option a featureThibault Saunier2020-06-031-2/+2
| | | | So user have more control on whether to build it or not
* flake8: fix errors with new flake8 3.8.0Christoph Reiter2020-05-172-4/+8
|
* get/set_focus_on_click: Fix return value, add a test and document why the ↵Christoph Reiter2020-04-171-0/+8
| | | | | | | override is there Also make it conditional on the Gtk.Widget method existing since that was only added with gtk 3.20 and we support 3.18+.
* Add a test scroll event attr mappingChristoph Reiter2020-04-171-0/+5
|
* tests: GtkWindowType has been removed from GTK4Jean Felder2020-04-171-1/+29
| | | | | | | | See gtk commit c1f71ee3e8add0c8e43445b888719ac85a743583. There are now top_level windows only. A new gtk4 test is added to check that windows are correctly created and work from builder.
* tests: GDK_RELEASE_MASK has been removed from GTK4Jean Felder2020-04-171-8/+10
| | | | See gtk commit 2244eeb7270f5a0b351aae98c19ddbc4d4b5bea7.
* gtktemplate: Do not crash on multiple init_template callsJean Felder2020-04-171-0/+30
| | | | | | | | | | | | | | | | | init_template method is automatically called when a widget is created and it is not supposed to be called multiple times. That is why this method is turned into a no-op after its first call via a lambda function. init_template can still be called after a widget creation (and it is supposed to do nothing). However, a second call will result in a crash because the lambda function has a parameter while init_template is not supposed to have any parameter. This issue is fixed by removing the parameter of the lambda function. A new test is also added to assert that a second init_template call does nothing.
* gtk overrides: Fix template hierarchy issueJean Felder2020-04-171-0/+70
| | | | | | | | | | | | | | | | | | | | When a widget is inside a template it is created through a g_object_new and does not have a python wrapper when pygobject__g_instance_init is called. In that case, a wrapper is created and the "__init__" method is called to instantiate it. Then, "init_template" is called to init its own template (if it exists). However, "init_template" needs to be called before the object constructor in order to create and instantiate all its children, signals and properties. This issue is fixed by calling init_template before the contructor if the python object has been created through g_object_new. A new test for the template hierarchy is added (based on an example from Marinus Schraal). Closes: #257, #386
* Rename PYGLIB_DEFINE_TYPE to PYGI_DEFINE_TYPEChristoph Reiter2020-04-161-6/+6
| | | | This is a leftover from when things were split up
* Remove all Python 2 C codeChristoph Reiter2020-04-161-9/+36
|
* Remove all Python 2 Python codeChristoph Reiter2020-04-1544-316/+86
|
* Gtk overrides: make sure TreeModelSort.new_with_model and ↵Christoph Reiter2020-03-171-0/+15
| | | | | | | | | TreeModel.sort_new_with_model exist In https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1134 the method was changed to a constructor which means the API is different between older and newer gtk. Add fallbacks for both in our overrides so both ways work all the time.
* tests: Add a Gtk4 test for drag and drop operationsJean Felder2020-03-161-13/+28
|
* gtk overrides: Drop Gtk.main for Gtk4Jean Felder2020-03-162-6/+26
| | | | | | | It has been removed (gtk commit 4dd780a96b1d37903ab88a4ae4536329cd9e164e) The associated tests are updated or skipped for Gtk 4.
* gtk overrides: Drop ToolButton for Gtk4Jean Felder2020-03-161-6/+0
| | | | | | | It has been removed (gtk commit 44e153d8a8679633681dd3ae2029735255e4f839). The associated test is removed.
* tests: don't use strict mode for xfail with the excepthook pluginChristoph Reiter2020-03-141-1/+1
| | | | | This no longer works since pytest 5.4.0. Somehow the xfail gets checked before the plugin runs so errors thrown in the plugin get ignored.