Commit d4704803 authored by Martin Panter's avatar Martin Panter

Fix buggy RE “\parrot_example.py”, uncovered by Issue #27030

parent 4f8aaf64
...@@ -9,6 +9,7 @@ import os ...@@ -9,6 +9,7 @@ import os
import codecs import codecs
import operator import operator
import io import io
import re
import tempfile import tempfile
import shutil import shutil
import unittest import unittest
...@@ -226,8 +227,8 @@ from __future__ import print_function""" ...@@ -226,8 +227,8 @@ from __future__ import print_function"""
actually_write=False) actually_write=False)
# Testing that it logged this message when write=False was passed is # Testing that it logged this message when write=False was passed is
# sufficient to see that it did not bail early after "No changes". # sufficient to see that it did not bail early after "No changes".
message_regex = r"Not writing changes to .*%s%s" % ( message_regex = r"Not writing changes to .*%s" % \
os.sep, os.path.basename(test_file)) re.escape(os.sep + os.path.basename(test_file))
for message in debug_messages: for message in debug_messages:
if "Not writing changes" in message: if "Not writing changes" in message:
self.assertRegex(message, message_regex) self.assertRegex(message, message_regex)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment