From c83e16ab2e3218c8bf12293fd6d8d7e68d959ecf Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 1 Jul 2020 20:20:09 +0300 Subject: [PATCH] code/source: remove unneeded assert inspect.getsource() definitely returns str. --- src/_pytest/_code/source.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/_pytest/_code/source.py b/src/_pytest/_code/source.py index eb4c4df78..1089b6ef0 100644 --- a/src/_pytest/_code/source.py +++ b/src/_pytest/_code/source.py @@ -309,7 +309,6 @@ def getrawcode(obj, trycall: bool = True): def getsource(obj) -> Source: obj = getrawcode(obj) strsrc = inspect.getsource(obj) - assert isinstance(strsrc, str) return Source(strsrc)