From af753771f5d4bdf3b27859f5809a1606f9f8b28e Mon Sep 17 00:00:00 2001 From: Nataliia Zakharchuk <62181026+Nattalli@users.noreply.github.com> Date: Thu, 8 Sep 2022 16:27:15 +0300 Subject: [PATCH] added test about comment --- tests/test_main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_main.py b/tests/test_main.py index 65a7fe09..c747c461 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -19,3 +19,13 @@ def test_count_occurrences(phrase, letter, count): f"Function 'count_occurrences' should return {count}, " f"when 'phrase'='{phrase}' and 'letter'='{letter}'" ) + + +def test_removed_comment(): +import app +with open(app.main.__file__, "r") as f: + file_content = f.read() + comment = re.compile("# write your code here") + assert not comment.search( + file_content + ), "You have to remove the unnecessary comment '# write your code here'"