You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.0 KiB
64 lines
2.0 KiB
From 3fb19efcf2d64ab628c706c08f536f4cac72fb70 Mon Sep 17 00:00:00 2001 |
|
From: Jakub Filak <jfilak@redhat.com> |
|
Date: Wed, 3 Sep 2014 13:38:46 +0200 |
|
Subject: [LIBREPORT PATCH 57/93] testsuite: work around the issue with |
|
'report-python' |
|
|
|
Signed-off-by: Jakub Filak <jfilak@redhat.com> |
|
|
|
Conflicts: |
|
src/report-python/__init__.py |
|
--- |
|
src/report-python/__init__.py | 10 +++++++++- |
|
tests/osinfo.at | 1 + |
|
tests/report_python.at | 1 + |
|
3 files changed, 11 insertions(+), 1 deletion(-) |
|
|
|
diff --git a/src/report-python/__init__.py b/src/report-python/__init__.py |
|
index b434672..b0ba497 100644 |
|
--- a/src/report-python/__init__.py |
|
+++ b/src/report-python/__init__.py |
|
@@ -13,7 +13,15 @@ |
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
|
|
|
from _pyreport import * |
|
-from report.io import TextIO, GTKIO, NewtIO |
|
+ |
|
+try: |
|
+ from report.io import TextIO, GTKIO, NewtIO |
|
+except ImportError: |
|
+ # Support testing |
|
+ _temp = __import__("io", globals(), locals(), ["TextIO", "GTKIO", "NewtIO"], -1) |
|
+ TextIO = _temp.TextIO |
|
+ GTKIO = _temp.GTKIO |
|
+ NewtIO = _temp.NewtIO |
|
|
|
#Compatibility with report package: |
|
# Author(s): Gavin Romig-Koch <gavin@redhat.com> |
|
diff --git a/tests/osinfo.at b/tests/osinfo.at |
|
index b57452d..868a9a2 100644 |
|
--- a/tests/osinfo.at |
|
+++ b/tests/osinfo.at |
|
@@ -401,6 +401,7 @@ int main(void) |
|
AT_PYTESTFUN([parse_osinfo_python], |
|
[[import sys |
|
|
|
+sys.path.insert(0, "../../../src/report-python") |
|
sys.path.insert(0, "../../../src/report-python/.libs") |
|
|
|
report = __import__("report-python", globals(), locals(), [], -1) |
|
diff --git a/tests/report_python.at b/tests/report_python.at |
|
index 17e4fb3..5569b1f 100644 |
|
--- a/tests/report_python.at |
|
+++ b/tests/report_python.at |
|
@@ -9,6 +9,7 @@ AT_BANNER([report_python]) |
|
AT_PYTESTFUN([get_from_etc_os_release], |
|
[[import sys |
|
|
|
+sys.path.insert(0, "../../../src/report-python") |
|
sys.path.insert(0, "../../../src/report-python/.libs") |
|
|
|
report = __import__("report-python", globals(), locals(), [], -1) |
|
-- |
|
1.8.3.1 |
|
|
|
|