From 59a8a3e27062b035f1791905773a3a577378ccbf Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 1 Nov 2021 09:28:51 +0100 Subject: [PATCH] Make pytest show the diff between assertion operands. Closes GH-118. --- conftest.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/conftest.py b/conftest.py index 5bb5ef2..76ddde0 100644 --- a/conftest.py +++ b/conftest.py @@ -3,8 +3,18 @@ import importlib import _pytest.unittest import pytest -from irctest.basecontrollers import BaseClientController, BaseServerController -from irctest.cases import BaseClientTestCase, BaseServerTestCase, _IrcTestCase +# Must be called before importing irctest.cases. +pytest.register_assert_rewrite("irctest.cases") + +from irctest.basecontrollers import ( # noqa: E402 + BaseClientController, + BaseServerController, +) +from irctest.cases import ( # noqa: E402 + BaseClientTestCase, + BaseServerTestCase, + _IrcTestCase, +) def pytest_addoption(parser):