Debian Codegraph @

tests/test_testing.py

raw
1 # SPDX-FileCopyrightText: 2021 CERN.
2 # SPDX-License-Identifier: MIT
3
4 import unittest
5
6 import pytest
7
8 from dictdiffer.testing import assert_no_diff
9
10
11 class AssertNoDiffTest(unittest.TestCase):
12 def test_passes(self):
13 dict1 = {1: '1'}
14 assert_no_diff(dict1, dict1)
15
16 def test_raises_assertion_error(self):
17 dict1 = {1: '1'}
18 dict2 = {2: '2'}
19 with pytest.raises(AssertionError):
20 assert_no_diff(dict1, dict2)