MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / random_update_order_parameters

Method random_update_order_parameters

test/sql/test_update.py:864–893  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

862 )
863
864 def random_update_order_parameters():
865 from sqlalchemy import ARRAY
866
867 t = table(
868 "foo",
869 column("data1", ARRAY(Integer)),
870 column("data2", ARRAY(Integer)),
871 column("data3", ARRAY(Integer)),
872 column("data4", ARRAY(Integer)),
873 )
874
875 idx_to_value = [
876 (t.c.data1, 5, 7),
877 (t.c.data2, 10, 18),
878 (t.c.data3, 8, 4),
879 (t.c.data4, 12, 14),
880 ]
881
882 def combinations():
883 while True:
884 random.shuffle(idx_to_value)
885 yield list(idx_to_value)
886
887 return testing.combinations(
888 *[
889 (t, combination)
890 for i, combination in zip(range(10), combinations())
891 ],
892 argnames="t, idx_to_value",
893 )
894
895 @random_update_order_parameters()
896 def test_update_to_expression_two(self, t, idx_to_value):

Callers

nothing calls this directly

Calls 5

tableFunction · 0.90
columnFunction · 0.90
ARRAYClass · 0.90
combinationsFunction · 0.85
combinationsMethod · 0.45

Tested by

no test coverage detected