From bedd9ee315d1a6101b55e524097c8e820b49bb53 Mon Sep 17 00:00:00 2001 From: Matthew Duggan Date: Mon, 18 Aug 2014 21:13:03 +0900 Subject: [PATCH] Don't test refcounts in pypy as they don't make sense there --- test/test_commit.py | 1 + test/test_remote.py | 7 ++++++- test/test_repository.py | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/test/test_commit.py b/test/test_commit.py index 0ce5223..75470ab 100644 --- a/test/test_commit.py +++ b/test/test_commit.py @@ -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) diff --git a/test/test_remote.py b/test/test_remote.py index aea1bb0..97cb72f 100644 --- a/test/test_remote.py +++ b/test/test_remote.py @@ -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): diff --git a/test/test_repository.py b/test/test_repository.py index 53def2c..082876a 100644 --- a/test/test_repository.py +++ b/test/test_repository.py @@ -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'