diff --git a/tests/unit/core/test_issue.py b/tests/unit/core/test_issue.py index 5d6d4fcf..b05d8992 100644 --- a/tests/unit/core/test_issue.py +++ b/tests/unit/core/test_issue.py @@ -22,12 +22,12 @@ def test_issue_create(self): def test_issue_str(self): test_issue = _get_issue_instance() expect = ("Issue: 'Test issue' from B999:bandit_plugin:" - f' CWE: {str(Cwe(Cwe.MULTIPLE_BINDS))},' + ' CWE: %s,' " Severity: MEDIUM " "Confidence: MEDIUM at code.py:1") self.assertEqual( - expect, + expect % str(Cwe(Cwe.MULTIPLE_BINDS)), str(test_issue) ) diff --git a/tests/unit/formatters/test_text.py b/tests/unit/formatters/test_text.py index af4d411e..99039a5f 100644 --- a/tests/unit/formatters/test_text.py +++ b/tests/unit/formatters/test_text.py @@ -132,7 +132,7 @@ def test_report_nobaseline(self, get_issue_list): 'binding.py (score: ', "CONFIDENCE: 1", "SEVERITY: 1", - f'CWE: {str(Cwe(Cwe.MULTIPLE_BINDS))}', + "CWE: %s" % str(Cwe(Cwe.MULTIPLE_BINDS)), 'Files excluded (1):', 'def.py', 'Undefined: 1',