File: test_testing.py

package info (click to toggle)
dictdiffer 0.9.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 296 kB
  • sloc: python: 1,519; makefile: 153; sh: 6
file content (25 lines) | stat: -rw-r--r-- 605 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# This file is part of Dictdiffer.
#
# Copyright (C) 2021 CERN.
#
# Dictdiffer is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more
# details.

import unittest

import pytest

from dictdiffer.testing import assert_no_diff


class AssertNoDiffTest(unittest.TestCase):
    def test_passes(self):
        dict1 = {1: '1'}
        assert_no_diff(dict1, dict1)

    def test_raises_assertion_error(self):
        dict1 = {1: '1'}
        dict2 = {2: '2'}
        with pytest.raises(AssertionError):
            assert_no_diff(dict1, dict2)