Skip to content

Commit 207e0a2

Browse files
authored
test fixes from scikit-buildcore branch (#364)
1 parent b8e12ff commit 207e0a2

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

python/integration-tests/compiler/var_length_short_calculation_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ def test_input_output_keys():
2121
k, v = line.split('\t')
2222
key = json.loads(k)
2323
value = json.loads(v)
24-
compiler.Add(key, value)
24+
compiler.add(key, value)
2525
input_keys_count += 1
2626

2727
output_keys_count = 0
2828
with tmp_dictionary(compiler, 'var_length_short_test.kv') as d:
29-
for _ in d.GetAllItems():
29+
for _ in d.items():
3030
output_keys_count += 1
3131

3232
assert input_keys_count == output_keys_count

python/integration-tests/dictionary/dictionary_leak_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def memory_usage_ps():
2222

2323
def test_leak():
2424
c = JsonDictionaryCompiler({"memory_limit_mb":"10"})
25-
c.Add("something", '["a" : 2]')
25+
c.add("something", '["a" : 2]')
2626

2727
with tmp_dictionary(c, 'near_simple.kv') as d:
2828
gc.collect()

python/tests/dictionary/loading_test.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ def test_truncated_file_json():
3939
c.write_to_file(os.path.join(tmp_dir,'truncation_test.kv'))
4040
size = os.path.getsize(os.path.join(tmp_dir, 'truncation_test.kv'))
4141

42-
fd_in = open(os.path.join(tmp_dir,'truncation_test.kv'), 'rb')
43-
fd = open(os.path.join(tmp_dir,'truncation_test1.kv'), 'wb')
44-
fd.write(fd_in.read(int(size/2)))
45-
fd.close()
46-
47-
fd2 = open(os.path.join(tmp_dir,'truncation_test2.kv'), 'wb')
48-
fd2.write(fd_in.read(int(size-2)))
49-
fd2.close()
42+
with open(os.path.join(tmp_dir,'truncation_test.kv'), 'rb') as fd_in:
43+
fd = open(os.path.join(tmp_dir,'truncation_test1.kv'), 'wb')
44+
fd.write(fd_in.read(int(size/2)))
45+
fd.close()
46+
47+
fd2 = open(os.path.join(tmp_dir,'truncation_test2.kv'), 'wb')
48+
fd2.write(fd_in.read(int(size-2)))
49+
fd2.close()
5050

5151
with pytest.raises(ValueError):
5252
d=Dictionary(os.path.join(tmp_dir, 'truncation_test1.kv'))

python/tests/index/merger_binary_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

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

0 commit comments

Comments
 (0)