File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -838,16 +838,17 @@ def test_load_vectors(self):
838838 [1.0 , 2.0 , 3.0 ],
839839 [1.0 , 2.0 , 3.0 ]
840840 ]
841+ temp_dir = tempfile .mkdtemp ()
842+ load_vectors_path = os .path .join (temp_dir , "test_load_vectors" )
841843 try :
842- temp_dir = tempfile .mkdtemp ()
843- load_vectors_path = os .path .join (temp_dir , "test_load_vectors" )
844844 self .sc .parallelize (data ).saveAsTextFile (load_vectors_path )
845845 ret_rdd = MLUtils .loadVectors (self .sc , load_vectors_path )
846846 ret = ret_rdd .collect ()
847- ret .sort ()
848847 self .assertEqual (len (ret ), 2 )
849848 self .assertEqual (ret [0 ], DenseVector ([1.0 , 2.0 , 3.0 ]))
850849 self .assertEqual (ret [1 ], DenseVector ([1.0 , 2.0 , 3.0 ]))
850+ except :
851+ self .fail ()
851852 finally :
852853 shutil .rmtree (load_vectors_path )
853854
You can’t perform that action at this time.
0 commit comments