Merge lp:~msabramo/python-jenkins/python3_small_tweaks into lp:~python-jenkins-developers/python-jenkins/trunk

Proposed by Marc Abramowitz
Status: Needs review
Proposed branch: lp:~msabramo/python-jenkins/python3_small_tweaks
Merge into: lp:~python-jenkins-developers/python-jenkins/trunk
Diff against target: 65 lines (+24/-3)
4 files modified
.bzrignore (+8/-0)
jenkins/__init__.py (+2/-2)
tests/test_jenkins.py (+1/-1)
tox.ini (+13/-0)
To merge this branch: bzr merge lp:~msabramo/python-jenkins/python3_small_tweaks
Reviewer Review Type Date Requested Status
Python Jenkins Developers Pending
Review via email: mp+214584@code.launchpad.net

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Marc Abramowitz (msabramo) wrote :

This also includes the tox.ini that I proposed adding in https://code.launchpad.net/~msabramo/python-jenkins/add_tox/+merge/214442

Revision history for this message
Marc Abramowitz (msabramo) wrote :

For a more ambitious Python 3 merge request, see: https://code.launchpad.net/~msabramo/python-jenkins/python3/+merge/214664

Unmerged revisions

25. By Marc Abramowitz <email address hidden>

A few small tweaks for Python 3 compat

24. By Marc Abramowitz <email address hidden>

Add .bzrignore

23. By Marc Abramowitz <email address hidden>

Add tox.ini for tox

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.bzrignore'
2--- .bzrignore 1970-01-01 00:00:00 +0000
3+++ .bzrignore 2014-04-07 17:24:12 +0000
4@@ -0,0 +1,8 @@
5+.tox
6+MANIFEST
7+*.egg-info
8+*.egg
9+*.pyc
10+__pycache__
11+build
12+dist
13
14=== modified file 'jenkins/__init__.py'
15--- jenkins/__init__.py 2013-09-28 20:00:43 +0000
16+++ jenkins/__init__.py 2014-04-07 17:24:12 +0000
17@@ -213,7 +213,7 @@
18 Print out job info in more readable format
19 '''
20 for k, v in self.get_job_info(job_name).iteritems():
21- print k, v
22+ print(k, v)
23
24 def jenkins_open(self, req, add_crumb=True):
25 '''
26@@ -227,7 +227,7 @@
27 if add_crumb:
28 self.maybe_add_crumb(req)
29 return urllib2.urlopen(req).read()
30- except urllib2.HTTPError, e:
31+ except urllib2.HTTPError as e:
32 # Jenkins's funky authentication means its nigh impossible to
33 # distinguish errors.
34 if e.code in [401, 403, 500]:
35
36=== modified file 'tests/test_jenkins.py'
37--- tests/test_jenkins.py 2012-05-17 15:24:23 +0000
38+++ tests/test_jenkins.py 2014-04-07 17:24:12 +0000
39@@ -2,7 +2,7 @@
40
41 from mock import patch
42
43-from helper import jenkins
44+from tests.helper import jenkins
45
46
47 class JenkinsTest(unittest.TestCase):
48
49=== added file 'tox.ini'
50--- tox.ini 1970-01-01 00:00:00 +0000
51+++ tox.ini 2014-04-07 17:24:12 +0000
52@@ -0,0 +1,13 @@
53+# Tox (http://tox.testrun.org/) is a tool for running tests
54+# in multiple virtualenvs. This configuration file will run the
55+# test suite on all supported python versions. To use it, "pip install tox"
56+# and then run "tox" from this directory.
57+
58+[tox]
59+envlist = py26, py27, pypy
60+
61+[testenv]
62+deps =
63+ mock
64+ pytest
65+commands = py.test tests

Subscribers

People subscribed via source and target branches