python-jenkins-developers team mailing list archive
-
python-jenkins-developers team
-
Mailing list archive
-
Message #00102
[Merge] lp:~msabramo/python-jenkins/python3_small_tweaks into lp:python-jenkins
Marc Abramowitz has proposed merging lp:~msabramo/python-jenkins/python3_small_tweaks into lp:python-jenkins.
Requested reviews:
Python Jenkins Developers (python-jenkins-developers)
For more details, see:
https://code.launchpad.net/~msabramo/python-jenkins/python3_small_tweaks/+merge/214584
This makes some small, hopefully non-controversial tweaks, that edge closer to Python 3 compatibility.
The tests still don't pass because of urllib2 stuff, but I thought I'd send a merge request with the non-controversial stuff, before I propose something bigger that uses, for example, six, to handle the moved modules.
--
https://code.launchpad.net/~msabramo/python-jenkins/python3_small_tweaks/+merge/214584
Your team Python Jenkins Developers is requested to review the proposed merge of lp:~msabramo/python-jenkins/python3_small_tweaks into lp:python-jenkins.
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2014-04-07 17:24:12 +0000
@@ -0,0 +1,8 @@
+.tox
+MANIFEST
+*.egg-info
+*.egg
+*.pyc
+__pycache__
+build
+dist
=== modified file 'jenkins/__init__.py'
--- jenkins/__init__.py 2013-09-28 20:00:43 +0000
+++ jenkins/__init__.py 2014-04-07 17:24:12 +0000
@@ -213,7 +213,7 @@
Print out job info in more readable format
'''
for k, v in self.get_job_info(job_name).iteritems():
- print k, v
+ print(k, v)
def jenkins_open(self, req, add_crumb=True):
'''
@@ -227,7 +227,7 @@
if add_crumb:
self.maybe_add_crumb(req)
return urllib2.urlopen(req).read()
- except urllib2.HTTPError, e:
+ except urllib2.HTTPError as e:
# Jenkins's funky authentication means its nigh impossible to
# distinguish errors.
if e.code in [401, 403, 500]:
=== modified file 'tests/test_jenkins.py'
--- tests/test_jenkins.py 2012-05-17 15:24:23 +0000
+++ tests/test_jenkins.py 2014-04-07 17:24:12 +0000
@@ -2,7 +2,7 @@
from mock import patch
-from helper import jenkins
+from tests.helper import jenkins
class JenkinsTest(unittest.TestCase):
=== added file 'tox.ini'
--- tox.ini 1970-01-01 00:00:00 +0000
+++ tox.ini 2014-04-07 17:24:12 +0000
@@ -0,0 +1,13 @@
+# Tox (http://tox.testrun.org/) is a tool for running tests
+# in multiple virtualenvs. This configuration file will run the
+# test suite on all supported python versions. To use it, "pip install tox"
+# and then run "tox" from this directory.
+
+[tox]
+envlist = py26, py27, pypy
+
+[testenv]
+deps =
+ mock
+ pytest
+commands = py.test tests
References