From bea4bde7cb88ceda248f60d29ec333930bcd83b9 Mon Sep 17 00:00:00 2001 From: HansBug Date: Sun, 19 Jun 2022 13:08:43 +0800 Subject: [PATCH 1/2] dev(hansbug): use older version of setuptools --- requirements-test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-test.txt b/requirements-test.txt index cbab620bb0..17f857db7e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -12,6 +12,7 @@ numpy>=1.10 torch>=1.1.0,<=1.10.0 easydict>=1.7,<2 testtools>=2 +setuptools<=59.5.0 dm-tree>=0.1.6 tianshou>=0.4.5 jax[cpu]>=0.2.17 \ No newline at end of file From ad94ebc8153e9cbd05d7f5965b622abcc7eddc7b Mon Sep 17 00:00:00 2001 From: HansBug Date: Sun, 19 Jun 2022 13:19:49 +0800 Subject: [PATCH 2/2] dev(hansbug): remove the minimal limit of the exported file --- test/entry/cli/test_export.py | 52 +++++++++++++++++------------------ test/tree/tree/test_io.py | 8 +++--- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/entry/cli/test_export.py b/test/entry/cli/test_export.py index 4c7985f719..907c79d240 100644 --- a/test/entry/cli/test_export.py +++ b/test/entry/cli/test_export.py @@ -32,7 +32,7 @@ def test_simple_export(self): assert result.exit_code == 0 assert os.path.exists('t1.btv') - assert 150 < os.path.getsize('t1.btv') < 240 + assert os.path.getsize('t1.btv') < 240 with open('t1.btv', 'rb') as file: assert load(file, type_=FastTreeValue) == t1 @@ -44,11 +44,11 @@ def test_multiple_export(self): assert result.exit_code == 0 assert os.path.exists('t1.btv') - assert 150 < os.path.getsize('t1.btv') < 240 + assert os.path.getsize('t1.btv') < 240 assert os.path.exists('t2.btv') - assert 200 < os.path.getsize('t2.btv') < 290 + assert os.path.getsize('t2.btv') < 290 assert os.path.exists('t3.btv') - assert 210 < os.path.getsize('t3.btv') < 260 + assert os.path.getsize('t3.btv') < 260 with open('t1.btv', 'rb') as file: assert load(file, type_=FastTreeValue) == t1 @@ -63,9 +63,9 @@ def test_multiple_export(self): assert result.exit_code == 0 assert not os.path.exists('t1.btv') assert os.path.exists('t2.btv') - assert 200 < os.path.getsize('t2.btv') < 290 + assert os.path.getsize('t2.btv') < 290 assert os.path.exists('t3.btv') - assert 210 < os.path.getsize('t3.btv') < 260 + assert os.path.getsize('t3.btv') < 260 with open('t2.btv', 'rb') as file: assert load(file, type_=FastTreeValue) == t2 @@ -80,11 +80,11 @@ def test_multiple_export_without_compression(self): assert result.exit_code == 0 assert os.path.exists('t1.btv') - assert 2120 < os.path.getsize('t1.btv') < 2170 + assert os.path.getsize('t1.btv') < 2170 assert os.path.exists('t2.btv') - assert 2120 < os.path.getsize('t2.btv') < 2220 + assert os.path.getsize('t2.btv') < 2220 assert os.path.exists('t3.btv') - assert 4120 < os.path.getsize('t3.btv') < 4170 + assert os.path.getsize('t3.btv') < 4170 with open('t1.btv', 'rb') as file: assert load(file, type_=FastTreeValue) == t1 @@ -100,11 +100,11 @@ def test_multiple_export_without_compression(self): assert result.exit_code == 0 assert os.path.exists('t1.btv') - assert 2120 < os.path.getsize('t1.btv') < 2170 + assert os.path.getsize('t1.btv') < 2170 assert os.path.exists('t2.btv') - assert 2120 < os.path.getsize('t2.btv') < 2230 + assert os.path.getsize('t2.btv') < 2230 assert os.path.exists('t3.btv') - assert 4120 < os.path.getsize('t3.btv') < 4170 + assert os.path.getsize('t3.btv') < 4170 with open('t1.btv', 'rb') as file: assert load(file, type_=FastTreeValue) == t1 @@ -121,11 +121,11 @@ def test_multiple_export_with_compress_define(self): assert result.exit_code == 0 assert os.path.exists('t1.btv') - assert 150 < os.path.getsize('t1.btv') < 220 + assert os.path.getsize('t1.btv') < 220 assert os.path.exists('t2.btv') - assert 160 < os.path.getsize('t2.btv') < 240 + assert os.path.getsize('t2.btv') < 240 assert os.path.exists('t3.btv') - assert 160 < os.path.getsize('t3.btv') < 210 + assert os.path.getsize('t3.btv') < 210 with open('t1.btv', 'rb') as file: assert load(file, type_=FastTreeValue) == t1 @@ -142,11 +142,11 @@ def test_multiple_export_with_compress_define(self): assert result.exit_code == 0 assert os.path.exists('t1.btv') - assert 260 < os.path.getsize('t1.btv') < 330 + assert os.path.getsize('t1.btv') < 330 assert os.path.exists('t2.btv') - assert 280 < os.path.getsize('t2.btv') < 430 + assert os.path.getsize('t2.btv') < 430 assert os.path.exists('t3.btv') - assert 280 < os.path.getsize('t3.btv') < 375 + assert os.path.getsize('t3.btv') < 375 with open('t1.btv', 'rb') as file: assert load(file, type_=FastTreeValue) == t1 @@ -169,9 +169,9 @@ def test_with_od(self): assert result.exit_code == 0 assert os.path.exists('subpath/t1.btv') - assert 200 < os.path.getsize('subpath/t1.btv') < 290 + assert os.path.getsize('subpath/t1.btv') < 290 assert os.path.exists('subpath/t2.btv') - assert 210 < os.path.getsize('subpath/t2.btv') < 260 + assert os.path.getsize('subpath/t2.btv') < 260 assert not os.path.exists('subpath/t3.btv') with open('subpath/t1.btv', 'rb') as file: @@ -192,9 +192,9 @@ def test_with_od(self): assert result.exit_code == 0 assert os.path.exists('subpath/t1.btv') - assert 200 < os.path.getsize('subpath/t1.btv') < 290 + assert os.path.getsize('subpath/t1.btv') < 290 assert os.path.exists('subpath/t2.btv') - assert 210 < os.path.getsize('subpath/t2.btv') < 260 + assert os.path.getsize('subpath/t2.btv') < 260 assert not os.path.exists('subpath/t3.btv') with open('subpath/t1.btv', 'rb') as file: @@ -213,9 +213,9 @@ def test_with_od(self): assert result.exit_code == 0 assert not os.path.exists('subpath/t1.btv') assert os.path.exists('subpath/t2.btv') - assert 200 < os.path.getsize('subpath/t2.btv') < 290 + assert os.path.getsize('subpath/t2.btv') < 290 assert os.path.exists('subpath/t3.btv') - assert 210 < os.path.getsize('subpath/t3.btv') < 260 + assert os.path.getsize('subpath/t3.btv') < 260 with open('subpath/t2.btv', 'rb') as file: assert load(file, type_=FastTreeValue) == t2 @@ -233,9 +233,9 @@ def test_with_od(self): assert not os.path.exists('t1.btv') assert not os.path.exists('t2.btv') assert os.path.exists('ppp.btv') - assert 200 < os.path.getsize('ppp.btv') < 290 + assert os.path.getsize('ppp.btv') < 290 assert os.path.exists('t3.btv') - assert 210 < os.path.getsize('t3.btv') < 260 + assert os.path.getsize('t3.btv') < 260 with open('ppp.btv', 'rb') as file: assert load(file, type_=FastTreeValue) == t2 diff --git a/test/tree/tree/test_io.py b/test/tree/tree/test_io.py index 5392c3c826..2fb20db076 100644 --- a/test/tree/tree/test_io.py +++ b/test/tree/tree/test_io.py @@ -17,7 +17,7 @@ def test_dumps_and_loads(self): _dumped_data = dumps(t) t1 = loads(_dumped_data, type_=FastTreeValue) - assert 2130 < len(_dumped_data) < 2170 + assert len(_dumped_data) < 2170 assert isinstance(t1, FastTreeValue) assert t1 == t @@ -36,7 +36,7 @@ def test_dumps_and_loads_with_zip(self): _dumped_data = dumps(t, compress=zlib) t1 = loads(_dumped_data, type_=FastTreeValue) - assert 210 < len(dumps(t, compress=zlib)) < 240 + assert len(dumps(t, compress=zlib)) < 240 assert isinstance(t1, FastTreeValue) assert t1 == t @@ -55,7 +55,7 @@ def test_dumps_and_loads_with_zip_tuple(self): _dumped_data = dumps(t, compress=(zlib.compress, zlib.decompress)) t1 = loads(_dumped_data, type_=FastTreeValue) - assert 210 < len(_dumped_data) < 240 + assert len(_dumped_data) < 240 assert isinstance(t1, FastTreeValue) assert t1 == t @@ -69,7 +69,7 @@ def test_dumps_and_loads_with_compress_only(self): _dumped_data = dumps(t, compress=zlib.compress) t1 = loads(_dumped_data, decompress=zlib.decompress, type_=FastTreeValue) - assert 130 < len(_dumped_data) < 170 + assert len(_dumped_data) < 170 assert isinstance(t1, FastTreeValue) assert t1 == t