Skip to content

Commit

Permalink
Fix flake8 linter warning W605 invalid escape sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
christophmeissner committed Mar 25, 2022
1 parent 724e301 commit 863aee8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion common/static_file_compressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CompressedStaticFilesStorage(StaticFilesStorage):
def __init__(self, location=None, base_url=None, *args, **kwargs):
super().__init__(location, base_url, *args, **kwargs)
for ext in self.EXTENSIONS:
self.EXT_LOOKUP[ext] = re.compile(".*\.{}\Z".format(ext))
self.EXT_LOOKUP[ext] = re.compile(r".*\.{}\Z".format(ext))

def post_process(self, paths, dry_run=False, **kwargs):
processing_files = []
Expand Down
18 changes: 9 additions & 9 deletions tests/_behave/steps/landing_page_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def find_statistics(context):
facts_div_containers = context.browser.find_elements_by_class_name("facts")
stats_div = facts_div_containers[0]

stats_reg_ex = "(^[0-9]+\n[A-Za-z ]+\n)*(^[0-9]+\n[A-Za-z ]+$)\Z"
stats_reg_ex = r"(^[0-9]+\n[A-Za-z ]+\n)*(^[0-9]+\n[A-Za-z ]+$)\Z"

match = re.match(stats_reg_ex, stats_div.text, re.MULTILINE)

Expand All @@ -55,18 +55,18 @@ def find_areas_and_facilities(context):
facts_div_containers = context.browser.find_elements_by_class_name("facts")
areas_facilities_div = facts_div_containers[1]

regex_heading = "^.*\n"
regex_one_area = "(^[\w ]+\n([\w ]+\u2022)*[\w ]+)"
regex_at_least_one_area = "(" + regex_one_area + "\n)*" + regex_one_area
regex_placeholder_msg = "There are currently no places in need of help."
regex_heading = r"^.*\n"
regex_one_area = r"(^[\w ]+\n([\w ]+\u2022)*[\w ]+)"
regex_at_least_one_area = r"(" + regex_one_area + r"\n)*" + regex_one_area
regex_placeholder_msg = r"There are currently no places in need of help."
regex_total = (
regex_heading
+ "("
+ r"("
+ regex_at_least_one_area
+ "|"
+ r"|"
+ regex_placeholder_msg
+ ")"
+ "\Z"
+ r")"
+ r"\Z"
)

match = re.match(regex_total, areas_facilities_div.text, re.MULTILINE | re.UNICODE)
Expand Down

0 comments on commit 863aee8

Please sign in to comment.