Beispiel #1
0
    def test_str_and_int_dont_match(self, mypy_nodes: MypyNodeFactory) -> None:
        int_var = mypy_nodes.get_int_var()
        str_var = mypy_nodes.get_str_var()

        result_a = compare_symbols(int_var, str_var)
        result_b = compare_symbols(str_var, int_var)

        assert result_a.match_result is MatchResult.MISMATCH
        assert result_b.match_result is MatchResult.MISMATCH
Beispiel #2
0
    def test_bool_more_specific_than_int(self,
                                         mypy_nodes: MypyNodeFactory) -> None:
        int_var = mypy_nodes.get_int_var()
        bool_var = mypy_nodes.get_bool_var()

        result_a = compare_symbols(int_var, bool_var)
        result_b = compare_symbols(bool_var, int_var)

        assert result_a.match_result is MatchResult.MISMATCH
        assert result_b.match_result is MatchResult.MATCH