diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2017-03-23 17:59:55 +0100 |
---|---|---|
committer | Christoph Reiter <creiter@src.gnome.org> | 2017-03-24 08:36:34 +0100 |
commit | 30228a98299eeb540fd014b9519a9efd4a434d4b (patch) | |
tree | 19621167b7b90e1116695d7fd1938d0d5c1a8fa7 /tests/test_glib.py | |
parent | 23deef70102657e75e07e54b4378c20214c867f3 (diff) | |
download | pygobject-30228a98299eeb540fd014b9519a9efd4a434d4b.tar.gz |
tests: Make test suite run on Windows
(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
Diffstat (limited to 'tests/test_glib.py')
-rw-r--r-- | tests/test_glib.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/test_glib.py b/tests/test_glib.py index dbde5897..ec0f87fa 100644 --- a/tests/test_glib.py +++ b/tests/test_glib.py @@ -1,6 +1,7 @@ # -*- Mode: Python -*- # encoding: UTF-8 +import os import sys import unittest import os.path @@ -14,9 +15,11 @@ from compathelper import _unicode, _bytes class TestGLib(unittest.TestCase): + + @unittest.skipIf(os.name == "nt", "no bash on Windows") def test_find_program_in_path(self): bash_path = GLib.find_program_in_path('bash') - self.assertTrue(bash_path.endswith('/bash')) + self.assertTrue(bash_path.endswith(os.path.sep + 'bash')) self.assertTrue(os.path.exists(bash_path)) self.assertEqual(GLib.find_program_in_path('non existing'), None) @@ -38,9 +41,9 @@ class TestGLib(unittest.TestCase): def test_xdg_dirs(self): d = GLib.get_user_data_dir() - self.assertTrue('/' in d, d) + self.assertTrue(os.path.sep in d, d) d = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DESKTOP) - self.assertTrue('/' in d, d) + self.assertTrue(os.path.sep in d, d) with warnings.catch_warnings(): warnings.simplefilter('ignore', PyGIDeprecationWarning) @@ -49,7 +52,7 @@ class TestGLib(unittest.TestCase): GLib.get_user_special_dir(GLib.USER_DIRECTORY_MUSIC)) for d in GLib.get_system_config_dirs(): - self.assertTrue('/' in d, d) + self.assertTrue(os.path.sep in d, d) for d in GLib.get_system_data_dirs(): self.assertTrue(isinstance(d, str), d) @@ -124,6 +127,7 @@ https://my.org/q?x=1&y=2 self.assertTrue(context.pending() in [True, False]) self.assertTrue(context.iteration(False) in [True, False]) + @unittest.skipIf(os.name == "nt", "hangs") def test_io_add_watch_no_data(self): (r, w) = os.pipe() call_data = [] @@ -147,6 +151,7 @@ https://my.org/q?x=1&y=2 self.assertEqual(call_data, [(r, GLib.IOCondition.IN, b'a'), (r, GLib.IOCondition.IN, b'b')]) + @unittest.skipIf(os.name == "nt", "hangs") def test_io_add_watch_with_data(self): (r, w) = os.pipe() call_data = [] @@ -170,6 +175,7 @@ https://my.org/q?x=1&y=2 self.assertEqual(call_data, [(r, GLib.IOCondition.IN, b'a', 'moo'), (r, GLib.IOCondition.IN, b'b', 'moo')]) + @unittest.skipIf(os.name == "nt", "hangs") def test_io_add_watch_with_multiple_data(self): (r, w) = os.pipe() call_data = [] @@ -191,6 +197,7 @@ https://my.org/q?x=1&y=2 self.assertEqual(call_data, [(r, GLib.IOCondition.IN, b'a', ('moo', 'foo'))]) + @unittest.skipIf(os.name == "nt", "no shell on Windows") def test_io_add_watch_pyfile(self): call_data = [] |