.. _assert-on-string-literal: assert-on-string-literal / W0129 ================================ **Message emitted:** ``Assert statement has a string literal as its first argument. The assert will %s fail.`` **Description:** *Used when an assert statement has a string literal as its first argument, which will cause the assert to always pass.* **Problematic code:** .. literalinclude:: /data/messages/a/assert-on-string-literal/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/a/assert-on-string-literal/good.py :language: python **Additional details:** Directly asserting a string literal 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. **Related links:** - `Tests without assertion `_ - `Testing that there is no error raised `_ - `Parametrizing conditional raising `_ Created by the `basic `__ checker.