fix tree_test for py2x, break it for py3x