Permalink
Browse files

Fix test_bgzf.py under Python 3 (use text mode handle)

  • Loading branch information...
1 parent 2cc4244 commit 0623a4b53f946d02de555aa91d3eef122bd5dd1b @peterjc peterjc committed Feb 1, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 Tests/test_bgzf.py
View
4 Tests/test_bgzf.py
@@ -323,14 +323,14 @@ def test_write_tell(self):
"""Check offset works during BGZF writing"""
temp_file = self.temp_file
- h = bgzf.open(temp_file, "w")
+ h = bgzf.open(temp_file, "w") #Text mode!
h.write("X" * 100000)
offset = h.tell()
self.assertNotEqual(offset, 100000) #Should be a virtual offset!
h.write("Magic" + "Y" * 100000)
h.close()
- h = bgzf.open(temp_file)
+ h = bgzf.open(temp_file, "r") #Text mode!
h.seek(offset)
self.assertEqual(h.read(5), "Magic")
h.close()

0 comments on commit 0623a4b

Please sign in to comment.