pytest-dev / unittest2pytest

helps rewriting Python `unittest` test-cases into `pytest` test-cases
GNU General Public License v3.0
128 stars 27 forks source link

Would be nice: fix assertEqual with singletons #52

Open nedbat opened 3 years ago

nedbat commented 3 years ago

Currently, unittest2pytest converts this:

self.assertEqual(thing, None)

to:

assert thing == None

which pylint then complains about (as it should).

Arguably, the original line was wrong, but it would be a nice touch if unittest2pytest noticed the value and converted it to:

assert thing is None