From: Denis Laxalde Date: Tue, 2 Nov 2021 10:24:30 +0000 (+0100) Subject: Work around a mypy 'Incompatible types in assignment' in sql tests X-Git-Tag: 3.0.2~4^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a48230a9a8897ca34f0525469939ac08d91034de;p=thirdparty%2Fpsycopg.git Work around a mypy 'Incompatible types in assignment' in sql tests By defining 'obj' as a Composed value, we avoid the mypy error about variable type change. --- diff --git a/tests/test_sql.py b/tests/test_sql.py index 44f0f0390..e551eda23 100644 --- a/tests/test_sql.py +++ b/tests/test_sql.py @@ -377,7 +377,7 @@ class TestSQL: assert obj.as_string(conn) == "foobar" def test_sum_inplace(self, conn): - obj = sql.SQL("foo") + obj = sql.SQL("f") + sql.SQL("oo") obj += sql.SQL("bar") assert isinstance(obj, sql.Composed) assert obj.as_string(conn) == "foobar"