Mercurial > python-hglib
comparison tests/test-import.py @ 118:e738d6fe5f3f 1.1
tests: make the tests work under Pypy (issue3965)
..which needs explicit close() due to lack of reference counting.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 23 Jun 2013 17:52:16 -0500 |
parents | 9746227239e0 |
children | 4359cabcb0cc |
comparison
equal
deleted
inserted
replaced
117:59cb26bf866e | 118:e738d6fe5f3f |
---|---|
20 def test_basic_cstringio(self): | 20 def test_basic_cstringio(self): |
21 self.client.import_(cStringIO.StringIO(patch)) | 21 self.client.import_(cStringIO.StringIO(patch)) |
22 self.assertEquals(self.client.cat(['a']), '1\n') | 22 self.assertEquals(self.client.cat(['a']), '1\n') |
23 | 23 |
24 def test_basic_file(self): | 24 def test_basic_file(self): |
25 open('patch', 'wb').write(patch) | 25 f = open('patch', 'wb') |
26 f.write(patch) | |
27 f.close() | |
26 | 28 |
27 # --no-commit | 29 # --no-commit |
28 self.client.import_(['patch'], nocommit=True) | 30 self.client.import_(['patch'], nocommit=True) |
29 self.assertEquals(open('a').read(), '1\n') | 31 self.assertEquals(open('a').read(), '1\n') |
30 | 32 |