MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_special_binops_checks

Method test_special_binops_checks

test/ext/test_associationproxy.py:740–795  ·  view source on GitHub ↗

test for #11349

(self)

Source from the content-addressed store, hash-verified

738 assert_raises(TypeError, set, [p1.children])
739
740 def test_special_binops_checks(self):
741 """test for #11349"""
742
743 Parent = self.classes.Parent
744
745 p1 = Parent("P1")
746 p1.children = ["a", "b", "c"]
747 control = {"a", "b", "c"}
748
749 with expect_raises(TypeError):
750 control | ["c", "d"]
751
752 with expect_raises(TypeError):
753 p1.children | ["c", "d"]
754
755 with expect_raises(TypeError):
756 control |= ["c", "d"]
757
758 with expect_raises(TypeError):
759 p1.children |= ["c", "d"]
760
761 with expect_raises(TypeError):
762 control & ["c", "d"]
763
764 with expect_raises(TypeError):
765 p1.children & ["c", "d"]
766
767 with expect_raises(TypeError):
768 control &= ["c", "d"]
769
770 with expect_raises(TypeError):
771 p1.children &= ["c", "d"]
772
773 with expect_raises(TypeError):
774 control ^ ["c", "d"]
775
776 with expect_raises(TypeError):
777 p1.children ^ ["c", "d"]
778
779 with expect_raises(TypeError):
780 control ^= ["c", "d"]
781
782 with expect_raises(TypeError):
783 p1.children ^= ["c", "d"]
784
785 with expect_raises(TypeError):
786 control - ["c", "d"]
787
788 with expect_raises(TypeError):
789 p1.children - ["c", "d"]
790
791 with expect_raises(TypeError):
792 control -= ["c", "d"]
793
794 with expect_raises(TypeError):
795 p1.children -= ["c", "d"]
796
797 def test_set_comparisons(self):

Callers

nothing calls this directly

Calls 2

expect_raisesFunction · 0.90
ParentClass · 0.70

Tested by

no test coverage detected