summaryrefslogtreecommitdiff
path: root/tests/test_mainloop.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove all Python 2 Python codeChristoph Reiter2020-04-151-2/+0
|
* setup.py: add option to run under gdbChristoph Reiter2018-03-151-0/+1
| | | | | | | setup.py test --gdb Also sets an env var so we can disable one test which uses SIGINT on the test process, which makes gdb break.
* tests: add a pytest hook for handling unhandled exception in closuresChristoph Reiter2018-02-161-20/+8
| | | | | | | | | | | | In PyGObject when an exception is raised in a closure called from C then the error gets passed to sys.excepthook (on the main thread at least) and the error is by default printed to stdout. Since pytest by default hides stdout, errors can be easily missed now. To make these errors more visible add a test wrapper which checks sys.excepthook for unhandled exceptions and reraises them. This makes the tests fail and as a bonus also shows the right stack trace instead of just the error message.
* tests: Make it possible to use pytest directlywip/creiter/pytest-directChristoph Reiter2018-02-121-0/+2
| | | | | | | | | | | 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: remove python 2.5/3.2 compat codeChristoph Reiter2017-04-021-3/+1
| | | | 2.7/3.3 support the u/b prefixes and both have callable()
* tests: Reduce usage of timeout_add() and sleep()Christoph Reiter2017-03-271-2/+11
| | | | | | | | | | * Instead of waiting for a fixed time, use a timeout and stop the main loop right after the test has succeeded. * Replace time.sleep to sync processes with os.pipe communication * Chain idle sources instead of using multiple timeout sources * Replace sleeps with unbufferd communication https://bugzilla.gnome.org/show_bug.cgi?id=698548
* tests: Remove TestMainLoop.test_concurrencyChristoph Reiter2017-03-271-27/+0
| | | | | | | | | | | | | | The code containing the bug no longer exists and the test doesn't do what it says. The thread never gets terminated and it doesn't assert anything. And I'm not sure what it should assert. For the corresponding bug see https://bugzilla.gnome.org/show_bug.cgi?id=663068 While the test doesn't hurt, it adds half a second wait time to the test suite. https://bugzilla.gnome.org/show_bug.cgi?id=698548
* tests: Make test suite run on WindowsChristoph Reiter2017-03-241-0/+4
| | | | | | | | | | | | (in a msys2 environment) * Replace LD_LIBRARY_PATH with gir code in runtests.py * Remove unneeded runtests-windows.py * Unset MSYSTEM to disable path separator hacks by msys2 * Set sys.path in runtests.py * Skip various tests failing/hanging/crashing on Windows https://bugzilla.gnome.org/show_bug.cgi?id=780396
* Remove static child_add_watch() bindingMartin Pitt2012-10-281-1/+1
| | | | | | Use the GLib API through GI instead, and provide override to keep backwards compatible API. Also allow using the actual GLib API, and deprecate the old static API of calling without a priority as first argument.
* Add some MainLoop, MainContext, and Source test casesMartin Pitt2012-10-231-0/+16
| | | | | | | These cover the remaining static API and behaviour, so that we have good regression tests for converting them to GI. See https://bugzilla.gnome.org/show_bug.cgi?id=686443
* test_mainloop code cleanupMartin Pitt2012-10-221-9/+10
| | | | | | Ensure that sys.excepthook is always restored, even if the test fails. Use the assert{True,False,Equal} unittest API instead of simple asserts for more useful failure messages.
* Fix test_mainloop.py for Python 3Martin Pitt2012-04-101-2/+7
|
* Add test case for multiple GLib.MainLoop instancesMartin Pitt2012-04-031-1/+24
| | | | | | | Commit 832f16f9 fixed a lockup with multiple GLib.MainLoops. Add corresponding test case. https://bugzilla.gnome.org/show_bug.cgi?id=663068
* PEP8: run via --fix from craigds forkJohan Dahlin2012-03-221-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=672627
* fix tests to use the new GLib moduleJohn (J5) Palmieri2011-08-111-4/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=642048
* refactor tests to only use PyGObject 3 syntaxJohn (J5) Palmieri2011-08-111-1/+2
| | | | | | | | | | | * for PyGObject 3 we want to discourage the use of legacy interfaces * Using interfaces like from gi.repository import GObject makes sure that the internal _gobject module is loaded and not PyGObject 2's gobject module which would cause the application to not work correctly https://bugzilla.gnome.org/show_bug.cgi?id=642048
* minor fixes in tests for py3k compatJohn (J5) Palmieri2010-09-171-1/+2
| | | | | | | | | | | | | | * add a _bytes wrapper for API that expects bytes in py3k but str in py2 * fix some more exception handling using sys.exc_info()[:2] * use range instead of xrange, items instead of iteritems since py3k dropped support for the different ways of accessing iterators - this is less efficient in py2 but we plan to target py3k as the primary platform * use list(dict.items()) since py3k only returns iterables which are not indexable * missed some _long wrapping https://bugzilla.gnome.org/show_bug.cgi?id=615872
* Clean and improve the test infrastructureSimon van der Linden2010-07-291-7/+4
| | | | | | | | | To run select tests, use for instance: % make check TEST_NAMES='test_everything test_gi.TestConstant' It works with check.gdb and check.valgrind too. https://bugzilla.gnome.org/show_bug.cgi?id=625488
* Move over glib constants to gobjectJohan Dahlin2008-07-261-3/+3
| | | | | | | | | | | | | | | | | | 2008-07-26 Johan Dahlin <johan@gnome.org> * glib/glibmodule.c (pyglib_register_constants), (init_glib): * gobject/__init__.py: * gobject/gobjectmodule.c (init_gobject): Move over glib constants to gobject * tests/test_gio.py: * tests/test_mainloop.py: * tests/test_source.py: * tests/test_subprocess.py: * tests/test_thread.py: Update tests to refer to glib when appropriate svn path=/trunk/; revision=858
* reindentJohan Dahlin2006-04-111-2/+2
|
* And the testJohan Dahlin2005-05-091-0/+53