From patchwork Wed Aug 14 20:14:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D6725: tests: split joint repo/changelog fake into one for each type From: phabricator X-Patchwork-Id: 41257 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 14 Aug 2019 20:14:21 +0000 durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I'm just not comfortable with fakes that get overloaded for multiple types: too often it gets out of hand and becomes difficult to trace. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6725 AFFECTED FILES tests/test-rust-discovery.py CHANGE DETAILS To: durin42, #hg-reviewers Cc: mercurial-devel diff --git a/tests/test-rust-discovery.py b/tests/test-rust-discovery.py --- a/tests/test-rust-discovery.py +++ b/tests/test-rust-discovery.py @@ -31,11 +31,14 @@ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00' ) +class fakechangelog(object): + def __init__(self, idx): + self.index = idx + class fakerepo(object): def __init__(self, idx): """Just make so that self.changelog.index is the given idx.""" - self.index = idx - self.changelog = self + self.changelog = fakechangelog(idx) @unittest.skipIf(PartialDiscovery is None or cparsers is None, "rustext or the C Extension parsers module "