コード例 #1
0
ファイル: assertions_test.py プロジェクト: pyarnold/Testify
    def test_message_param_not_deprecated(self):
        with warnings.catch_warnings(record=True) as w:
            assertions.assert_dict_subset({"a": 1, "b": 2},
                                          {"a": 1, "b": 2, "c": 3},
                                          message="This is a message")

            assertions.assert_equal(len(w), 0)
コード例 #2
0
ファイル: assertions_test.py プロジェクト: pyarnold/Testify
    def test_deprecated_msg_param(self):
        with warnings.catch_warnings(record=True) as w:
            assertions.assert_dict_subset({"a": 1, "b": 2},
                                          {"a": 1, "b": 2, "c": 3},
                                          msg="This is a message")

            assertions.assert_equal(len(w), 1)
            assert issubclass(w[-1].category, DeprecationWarning)
            assertions.assert_in("msg is deprecated", str(w[-1].message))
コード例 #3
0
    def test_message_param_not_deprecated(self):
        with warnings.catch_warnings(record=True) as w:
            assertions.assert_dict_subset({
                "a": 1,
                "b": 2
            }, {
                "a": 1,
                "b": 2,
                "c": 3
            },
                                          message="This is a message")

            assertions.assert_equal(len(w), 0)
コード例 #4
0
    def test_deprecated_msg_param(self):
        with warnings.catch_warnings(record=True) as w:
            assertions.assert_dict_subset({
                "a": 1,
                "b": 2
            }, {
                "a": 1,
                "b": 2,
                "c": 3
            },
                                          msg="This is a message")

            assertions.assert_equal(len(w), 1)
            assert issubclass(w[-1].category, DeprecationWarning)
            assertions.assert_in("msg is deprecated", str(w[-1].message))