From b14d5e950f69571a3109e7cfb2d91614dadb66f3 Mon Sep 17 00:00:00 2001 From: "Taewon D. Kim" Date: Sat, 23 Mar 2019 08:32:57 -0400 Subject: Add/modify tests for checking raw docstring in Similarities checker - Add an extra case to the examples used to test similarities checker - Modify outputs of tests (total number of lines and the percent changed) --- pylint/test/input/similar1 | 8 ++++++++ pylint/test/input/similar2 | 8 ++++++++ pylint/test/unittest_checker_similar.py | 8 ++++---- 3 files changed, 20 insertions(+), 4 deletions(-) (limited to 'pylint/test') diff --git a/pylint/test/input/similar1 b/pylint/test/input/similar1 index 2b04ee2f5..a533e2f6f 100644 --- a/pylint/test/input/similar1 +++ b/pylint/test/input/similar1 @@ -20,3 +20,11 @@ fifteen sixteen seventeen eighteen + + + + +nineteen +r""" +twenty +""" diff --git a/pylint/test/input/similar2 b/pylint/test/input/similar2 index 77f5f1ed6..79bcab2fd 100644 --- a/pylint/test/input/similar2 +++ b/pylint/test/input/similar2 @@ -20,3 +20,11 @@ FIFTEEN sixteen seventeen eighteen + + + + +NINETEEN +r""" +twenty +""" diff --git a/pylint/test/unittest_checker_similar.py b/pylint/test/unittest_checker_similar.py index a84883372..7470e06c9 100644 --- a/pylint/test/unittest_checker_similar.py +++ b/pylint/test/unittest_checker_similar.py @@ -48,7 +48,7 @@ def test_ignore_comments(): eight nine ''' ten -TOTAL lines=44 duplicates=10 percent=22.73 +TOTAL lines=60 duplicates=10 percent=16.67 """ % (SIMILAR1, SIMILAR2) ).strip() @@ -84,7 +84,7 @@ def test_ignore_docsrings(): three four five -TOTAL lines=44 duplicates=13 percent=29.55 +TOTAL lines=60 duplicates=13 percent=21.67 """ % ((SIMILAR1, SIMILAR2) * 2) ).strip() @@ -99,7 +99,7 @@ def test_ignore_imports(): assert ( output.getvalue().strip() == """ -TOTAL lines=44 duplicates=0 percent=0.00 +TOTAL lines=60 duplicates=0 percent=0.00 """.strip() ) @@ -169,7 +169,7 @@ def test_ignore_nothing(): three four five -TOTAL lines=44 duplicates=5 percent=11.36 +TOTAL lines=60 duplicates=5 percent=8.33 """ % (SIMILAR1, SIMILAR2) ).strip() -- cgit v1.2.1