Don't test refcounts in pypy as they don't make sense there

This commit is contained in:
Matthew Duggan
2014-08-18 21:13:03 +09:00
parent 99433ca66a
commit bedd9ee315
3 changed files with 13 additions and 1 deletions

View File

@@ -47,6 +47,7 @@ COMMIT_SHA = '5fe808e8953c12735680c257f56600cb0de44b10'
class CommitTest(utils.BareRepoTestCase):
@unittest.skipIf(__pypy__ is not None)
def test_commit_refcount(self):
commit = self.repo[COMMIT_SHA]
start = sys.getrefcount(commit)

View File

@@ -34,6 +34,11 @@ import sys
from pygit2 import Oid
from . import utils
try:
import __pypy__
except ImportError:
__pypy__ = None
REMOTE_NAME = 'origin'
REMOTE_URL = 'git://github.com/libgit2/pygit2.git'
REMOTE_FETCHSPEC_SRC = 'refs/heads/*'
@@ -164,12 +169,12 @@ class RepositoryTest(utils.RepoTestCase):
self.assertEqual('http://example.com/test.git',
self.repo.remotes[0].url)
@unittest.skipIf(__pypy__ is not None)
def test_remote_refcount(self):
start = sys.getrefcount(self.repo)
remote = self.repo.remotes[0]
del remote
end = sys.getrefcount(self.repo)
self.assertEqual(start, end)
def test_add_refspec(self):

View File

@@ -46,6 +46,11 @@ from pygit2 import Oid, Reference, hashfile
import pygit2
from . import utils
try:
import __pypy__
except ImportError:
__pypy__ = None
HEAD_SHA = '784855caf26449a1914d2cf62d12b9374d76ae78'
PARENT_SHA = 'f5e5aa4e36ab0fe62ee1ccc6eb8f79b866863b87' # HEAD^
@@ -151,6 +156,7 @@ class RepositoryTest(utils.BareRepoTestCase):
commit.message)
self.assertRaises(ValueError, self.repo.__getitem__, too_short_prefix)
@unittest.skipIf(__pypy__ is not None)
def test_lookup_commit_refcount(self):
start = sys.getrefcount(self.repo)
commit_sha = '5fe808e8953c12735680c257f56600cb0de44b10'