()
| 26 | |
| 27 | @pytest.mark.skip(reason="take too long") |
| 28 | def test_encode(): |
| 29 | # print("schema", foo_schema()) |
| 30 | encoder = fory.create_row_encoder(foo_schema()) |
| 31 | foo = create_foo() |
| 32 | row = encoder.to_row(foo) |
| 33 | assert foo == encoder.from_row(row) |
| 34 | |
| 35 | t1 = timeit.timeit(lambda: encoder.to_row(foo), number=iter_nums) |
| 36 | print("encoder take {0} for {1} times, avg: {2}".format(t1, iter_nums, t1 / iter_nums)) |
| 37 | t2 = timeit.timeit(lambda: pickle.dumps(foo), number=iter_nums) |
| 38 | print("pickle take {0} for {1} times, avg: {2}".format(t2, iter_nums, t2 / iter_nums)) |
| 39 | |
| 40 | |
| 41 | @pytest.mark.skip(reason="take too long") |
no test coverage detected