[libpeas] Silence an ImportError to stderr in the Python tests
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Silence an ImportError to stderr in the Python tests
- Date: Sat, 28 Jun 2014 12:57:18 +0000 (UTC)
commit ef46ba44998c220ed5e379132ad006f52ba86ad1
Author: Garrett Regier <garrettregier gmail com>
Date: Wed Jun 25 09:19:59 2014 -0700
Silence an ImportError to stderr in the Python tests
tests/libpeas/extension-py.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/tests/libpeas/extension-py.c b/tests/libpeas/extension-py.c
index a45ed47..a25b1fe 100644
--- a/tests/libpeas/extension-py.c
+++ b/tests/libpeas/extension-py.c
@@ -106,8 +106,19 @@ test_extension_py_activatable_subject_refcount (PeasEngine *engine,
g_object_unref (object);
}
+#if GLIB_CHECK_VERSION (2, 38, 0)
static void
-test_extension_py_nonexistent (PeasEngine *engine)
+test_extension_py_nonexistent (void)
+{
+ g_test_trap_subprocess (EXTENSION_TEST_NAME (PY_LOADER,
+ "nonexistent/subprocess"),
+ 0, 0);
+ g_test_trap_assert_passed ();
+ g_test_trap_assert_stderr ("*ImportError*");
+}
+
+static void
+test_extension_py_nonexistent_subprocess (PeasEngine *engine)
{
PeasPluginInfo *info;
@@ -120,7 +131,6 @@ test_extension_py_nonexistent (PeasEngine *engine)
g_assert (!peas_engine_load_plugin (engine, info));
}
-#if GLIB_CHECK_VERSION (2, 38, 0)
static void
test_extension_py_already_initialized (void)
{
@@ -221,9 +231,12 @@ main (int argc,
EXTENSION_TEST (PY_LOADER, "instance-refcount", instance_refcount);
EXTENSION_TEST (PY_LOADER, "activatable-subject-refcount",
activatable_subject_refcount);
- EXTENSION_TEST (PY_LOADER, "nonexistent", nonexistent);
#if GLIB_CHECK_VERSION (2, 38, 0)
+ EXTENSION_TEST_FUNC (PY_LOADER, "nonexistent", nonexistent);
+ EXTENSION_TEST (PY_LOADER, "nonexistent/subprocess",
+ nonexistent_subprocess);
+
EXTENSION_TEST_FUNC (PY_LOADER, "already-initialized", already_initialized);
EXTENSION_TEST_FUNC (PY_LOADER, "already-initialized/subprocess",
already_initialized_subprocess);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]