Skip to content

Add pypy3 to Travis #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 8, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ python:
- "3.3"
- "3.4"
- "pypy"
- "pypy3"

env: LIBGIT2=~/libgit2/_install/ LD_LIBRARY_PATH=~/libgit2/_install/lib

Expand Down
9 changes: 6 additions & 3 deletions test/test_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@
from pygit2 import GIT_OBJ_COMMIT, Signature, Oid
from . import utils

# pypy raises TypeError on writing to read-only, so we need to check
# and change the test accordingly
# pypy (in python2 mode) raises TypeError on writing to read-only, so
# we need to check and change the test accordingly
try:
import __pypy__
import __pypy__, sys
pypy2 = sys.version_info[0] < 3
except ImportError:
__pypy__ = None
pypy2 = False

COMMIT_SHA = '5fe808e8953c12735680c257f56600cb0de44b10'

Expand Down Expand Up @@ -149,7 +152,7 @@ def test_modify_commit(self):

commit = self.repo[COMMIT_SHA]

error_type = AttributeError if not __pypy__ else TypeError
error_type = AttributeError if not pypy2 else TypeError
self.assertRaises(error_type, setattr, commit, 'message', message)
self.assertRaises(error_type, setattr, commit, 'committer', committer)
self.assertRaises(error_type, setattr, commit, 'author', author)
Expand Down
10 changes: 6 additions & 4 deletions test/test_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@
import pygit2
from . import utils

# pypy raises TypeError on writing to read-only, so we need to check
# and change the test accordingly
# pypy (in python2 mode) raises TypeError on writing to read-only, so
# we need to check and change the test accordingly
try:
import __pypy__
import __pypy__, sys
pypy2 = sys.version_info[0] < 3
except ImportError:
__pypy__ = None
pypy2 = False

TAG_SHA = '3d2962987c695a29f1f80b6c3aa4ec046ef44369'

Expand Down Expand Up @@ -90,7 +92,7 @@ def test_modify_tag(self):
tagger = ('John Doe', '[email protected]', 12347)

tag = self.repo[TAG_SHA]
error_type = AttributeError if not __pypy__ else TypeError
error_type = AttributeError if not pypy2 else TypeError
self.assertRaises(error_type, setattr, tag, 'name', name)
self.assertRaises(error_type, setattr, tag, 'target', target)
self.assertRaises(error_type, setattr, tag, 'tagger', tagger)
Expand Down