unittest word diff on strings /u/Informal-Addendum435 Python Education

from unittest import TestCase class TestSomething(TestCase): def test_something(self): self.assertMultiLineEqual('one two three', 'one three three') 

produces the error message

AssertionError: 'one two three' != 'one three three' - one two three ? ^^ + one three three ? ^^^^ 

But I would find it more useful to see mismatches inline, like git --word-diff=color shows.

How can I use unittest and other libraries to do something like that?

submitted by /u/Informal-Addendum435
[link] [comments]

​r/learnpython from unittest import TestCase class TestSomething(TestCase): def test_something(self): self.assertMultiLineEqual(‘one two three’, ‘one three three’) produces the error message AssertionError: ‘one two three’ != ‘one three three’ – one two three ? ^^ + one three three ? ^^^^ But I would find it more useful to see mismatches inline, like git –word-diff=color shows. How can I use unittest and other libraries to do something like that? submitted by /u/Informal-Addendum435 [link] [comments] 

from unittest import TestCase class TestSomething(TestCase): def test_something(self): self.assertMultiLineEqual('one two three', 'one three three') 

produces the error message

AssertionError: 'one two three' != 'one three three' - one two three ? ^^ + one three three ? ^^^^ 

But I would find it more useful to see mismatches inline, like git --word-diff=color shows.

How can I use unittest and other libraries to do something like that?

submitted by /u/Informal-Addendum435
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *