These two patches fix the errors. Also, python-pytest and python3-pytest must 
be added as build dependencies.
>From de7273e04b3c8e4ca3f8ba32298a5d3d763b3ab3 Mon Sep 17 00:00:00 2001
From: Sid Shanker <sshanker...@gmail.com>
Date: Sun, 17 May 2015 23:11:02 -0700
Subject: [PATCH] Fixed utf-8 decoding error in build.

---
 test/run.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/test/run.py b/test/run.py
index a48e1fb..d730914 100755
--- a/test/run.py
+++ b/test/run.py
@@ -290,9 +290,12 @@ def collect_dir_tests(base_dir, test_files, check_thirdparty=False):
                     skip = 'Thirdparty-Library %s not found.' % lib
 
             path = os.path.join(base_dir, f_name)
-            source = open(path).read()
-            if not is_py3:
-                source = unicode(source, 'UTF-8')
+
+            if is_py3:
+                source = open(path, encoding='utf-8').read()
+            else:
+                source = unicode(open(path).read(), 'UTF-8')
+
             for case in collect_file_tests(StringIO(source),
                                            lines_to_execute):
                 case.path = path
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 python-jedi (0.9.0-1) unstable; urgency=medium
 .
   * New upstream release
   * debian/watch: use pypi.debian.net redirector
Author: Piotr Ożarowski <pi...@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2016-11-16

--- python-jedi-0.9.0.orig/test/test_integration_import.py
+++ python-jedi-0.9.0/test/test_integration_import.py
@@ -18,22 +18,22 @@ def test_goto_definition_on_import():
 def test_complete_on_empty_import():
     assert Script("from datetime import").completions()[0].name == 'import'
     # should just list the files in the directory
-    assert 10 < len(Script("from .", path='').completions()) < 30
+    assert 10 < len(Script("from .", path='whatever.py').completions()) < 30
 
     # Global import
-    assert len(Script("from . import", 1, 5, '').completions()) > 30
+    assert len(Script("from . import", 1, 5, 'whatever.py').completions()) > 30
     # relative import
-    assert 10 < len(Script("from . import", 1, 6, '').completions()) < 30
+    assert 10 < len(Script("from . import", 1, 6, 'whatever.py').completions()) < 30
 
     # Global import
-    assert len(Script("from . import classes", 1, 5, '').completions()) > 30
+    assert len(Script("from . import classes", 1, 5, 'whatever.py').completions()) > 30
     # relative import
-    assert 10 < len(Script("from . import classes", 1, 6, '').completions()) < 30
+    assert 10 < len(Script("from . import classes", 1, 6, 'whatever.py').completions()) < 30
 
     wanted = set(['ImportError', 'import', 'ImportWarning'])
     assert set([c.name for c in Script("import").completions()]) == wanted
     if not is_py26:  # python 2.6 doesn't always come with a library `import*`.
-        assert len(Script("import import", path='').completions()) > 0
+        assert len(Script("import import", path='whatever.py').completions()) > 0
 
     # 111
     assert Script("from datetime import").completions()[0].name == 'import'

Reply via email to