.. _assert-on-tuple:

assert-on-tuple / W0199
=======================

**Message emitted:**

Assert called on a populated tuple. Did you mean 'assert x,y'?

**Description:**

*A call of assert on a tuple will always evaluate to true if the tuple is not empty, and will always evaluate to false if it is.*

**Problematic code:**

.. literalinclude:: /data/messages/a/assert-on-tuple/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/a/assert-on-tuple/good.py
   :language: python

**Additional details:**

Directly asserting a non-empty tuple will always pass. The solution is to
 test something that could fail, or not assert at all.

 For ``unittest`` assertions there is the similar :ref:`redundant-unittest-assert` message.


Created by the `basic <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/base/basic_checker.py>`__ checker.