[docopt.cpp] 05/07: Run the tests using Python 3 instead of Python 2
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Mar 9 08:39:42 UTC 2017
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository docopt.cpp.
commit 383a06c0a79965596a4423f42a9460013a870f19
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date: Thu Mar 2 11:06:51 2017 +0000
Run the tests using Python 3 instead of Python 2
- Testing now depends on any Python 3 interpreter
- New patch Make-tests-compatible-with-Python-3.patch
Gbp-Dch: full
---
debian/control | 2 +-
.../Make-tests-compatible-with-Python-3.patch | 54 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 56 insertions(+), 1 deletion(-)
diff --git a/debian/control b/debian/control
index 5e79d20..5c8d05d 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Priority: optional
Build-Depends: cmake (>= 3.1),
debhelper (>= 10),
dpkg-dev (>= 1.17.14),
- python <!nocheck>
+ python3:any <!nocheck>
Standards-Version: 3.9.8
Vcs-Browser: https://anonscm.debian.org/git/debian-science/packages/docopt.cpp.git
Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/docopt.cpp.git
diff --git a/debian/patches/Make-tests-compatible-with-Python-3.patch b/debian/patches/Make-tests-compatible-with-Python-3.patch
new file mode 100644
index 0000000..2b240a0
--- /dev/null
+++ b/debian/patches/Make-tests-compatible-with-Python-3.patch
@@ -0,0 +1,54 @@
+From: Ghislain Antony Vaillant <ghisvail at gmail.com>
+Date: Thu, 2 Mar 2017 11:05:32 +0000
+Subject: Make tests compatible with Python 3
+
+---
+ run_tests.py | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/run_tests.py b/run_tests.py
+index ef723b4..481b265 100755
+--- a/run_tests.py
++++ b/run_tests.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+
+ import re
+ import sys
+@@ -43,7 +43,7 @@ for _, doc, cases in parse_test(tests):
+ if expect_error:
+ error = " ** an error was expected but it appeared to succeed!"
+ else:
+- json_out = json.loads(out)
++ json_out = json.loads(out.decode())
+ if expect != json_out:
+ error = " ** JSON does not match expected: %r" % expect
+ except subprocess.CalledProcessError as e:
+@@ -56,17 +56,17 @@ for _, doc, cases in parse_test(tests):
+
+ failures += 1
+
+- print "="*40
+- print doc
+- print ':'*20
+- print prog, argv
+- print '-'*20
++ print("="*40)
++ print(doc)
++ print(':'*20)
++ print(prog, argv)
++ print('-'*20)
+ if out:
+- print out
+- print error
++ print(out)
++ print(error)
+
+ if failures:
+- print "%d failures" % failures
++ print("%d failures" % failures)
+ sys.exit(1)
+ else:
+- print "PASS (%d)" % passes
++ print("PASS (%d)" % passes)
diff --git a/debian/patches/series b/debian/patches/series
index 4f25549..21069b9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
Set-versioning-properties.patch
+Make-tests-compatible-with-Python-3.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/docopt.cpp.git
More information about the debian-science-commits
mailing list