From d48679a0b15feae754ebe9ef4c9d5809db0c0d08 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Sun, 2 Oct 2016 01:10:47 +0200 Subject: tc: HALF FIX of `test_pack_entity ()` + On Windows, you cannot write onto a file held by another live file-pointer (test_pack.py:#L204). + The TC fails later, on clean up (the usual). --- gitdb/test/test_pack.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gitdb/test') diff --git a/gitdb/test/test_pack.py b/gitdb/test/test_pack.py index 601c0ea..6e31363 100644 --- a/gitdb/test/test_pack.py +++ b/gitdb/test/test_pack.py @@ -188,7 +188,8 @@ class TestPack(TestBase): # pack writing - write all packs into one # index path can be None - pack_path = tempfile.mktemp('', "pack", rw_dir) + pack_path1 = tempfile.mktemp('', "pack1", rw_dir) + pack_path2 = tempfile.mktemp('', "pack2", rw_dir) index_path = tempfile.mktemp('', 'index', rw_dir) iteration = 0 @@ -196,7 +197,9 @@ class TestPack(TestBase): for obj in pack_objs: obj.stream.seek(0) # END utility - for ppath, ipath, num_obj in zip((pack_path, ) * 2, (index_path, None), (len(pack_objs), None)): + for ppath, ipath, num_obj in zip((pack_path1, pack_path2), + (index_path, None), + (len(pack_objs), None)): iwrite = None if ipath: ifile = open(ipath, 'wb') @@ -214,7 +217,7 @@ class TestPack(TestBase): assert os.path.getsize(ppath) > 100 # verify pack - pf = PackFile(ppath) + pf = PackFile(ppath) # FIXME: Leaks file-pointer(s)! assert pf.size() == len(pack_objs) assert pf.version() == PackFile.pack_version_default assert pf.checksum() == pack_sha -- cgit v1.2.1