diff options
-rw-r--r-- | git/test/test_base.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/git/test/test_base.py b/git/test/test_base.py index 9ae2dd2b..301384ef 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -4,10 +4,10 @@ # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php - -import git.objects.base as base import os +import tempfile +import git.objects.base as base from git.test.lib import ( TestBase, assert_raises, @@ -69,10 +69,13 @@ class TestBase(TestBase): data = data_stream.read() assert data - tmpfile = os.tmpfile() + tmpfilename = tempfile.mktemp(suffix='test-stream') + tmpfile = open(tmpfilename, 'wb+') assert item == item.stream_data(tmpfile) tmpfile.seek(0) assert tmpfile.read() == data + tmpfile.close() + os.remove(tmpfilename) # END stream to file directly # END for each object type to create @@ -113,7 +116,7 @@ class TestBase(TestBase): filename = u"שלום.txt" file_path = os.path.join(rw_repo.working_dir, filename) - open(file_path, "wb").write('something') + open(file_path, "wb").write(b'something') rw_repo.git.add(rw_repo.working_dir) rw_repo.index.commit('message') |