Skip to content

Commit

Permalink
fix test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmuhs committed Nov 24, 2024
1 parent 4b5d100 commit f39b089
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions python/tests/dictionary/loading_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def test_truncated_file_json():
c.WriteToFile(os.path.join(tmp_dir,'truncation_test.kv'))
size = os.path.getsize(os.path.join(tmp_dir, 'truncation_test.kv'))

fd_in = open(os.path.join(tmp_dir,'truncation_test.kv'), 'rb')
fd = open(os.path.join(tmp_dir,'truncation_test1.kv'), 'wb')
fd.write(fd_in.read(int(size/2)))
fd.close()

fd2 = open(os.path.join(tmp_dir,'truncation_test2.kv'), 'wb')
fd2.write(fd_in.read(int(size-2)))
fd2.close()
with open(os.path.join(tmp_dir,'truncation_test.kv'), 'rb') as fd_in:
fd = open(os.path.join(tmp_dir,'truncation_test1.kv'), 'wb')
fd.write(fd_in.read(int(size/2)))
fd.close()

fd2 = open(os.path.join(tmp_dir,'truncation_test2.kv'), 'wb')
fd2.write(fd_in.read(int(size-2)))
fd2.close()

with pytest.raises(ValueError):
d=Dictionary(os.path.join(tmp_dir, 'truncation_test1.kv'))
Expand Down
2 changes: 1 addition & 1 deletion python/tests/index/merger_binary_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@

def test_merger_binary():
cmd = get_interpreter_executable() + b" " + os.path.join(get_package_root(), b"_pycore" , b"keyvimerger.py") + b" -h"
rc = subprocess.call(cmd, shell=True, stdout=open(os.devnull, 'w'))
rc = subprocess.call(cmd, shell=True)
assert rc == 0

0 comments on commit f39b089

Please sign in to comment.