summaryrefslogtreecommitdiff
path: root/gitdb/test
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-10-02 01:10:47 +0200
committerKostis Anagnostopoulos <ankostis@gmail.com>2016-10-22 04:08:26 +0200
commitd48679a0b15feae754ebe9ef4c9d5809db0c0d08 (patch)
treeb6b4f41427211f4acdce9617514fe69e0b89aff3 /gitdb/test
parent587dc4ec1311e135d70996a077a2f978e303d3fc (diff)
downloadgitdb-d48679a0b15feae754ebe9ef4c9d5809db0c0d08.tar.gz
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).
Diffstat (limited to 'gitdb/test')
-rw-r--r--gitdb/test/test_pack.py9
1 files changed, 6 insertions, 3 deletions
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