From 0f35b22271f4e12a5ac9591581ea23020f664140 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Thu, 16 Jul 2020 14:48:42 +0200 Subject: [PATCH 1/2] Document that sanity functions use 're.MULTILINE' --- reframe/utility/sanity.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/reframe/utility/sanity.py b/reframe/utility/sanity.py index d3a47f9af5..75f101568d 100644 --- a/reframe/utility/sanity.py +++ b/reframe/utility/sanity.py @@ -362,7 +362,10 @@ def assert_found(patt, filename, msg=None, encoding='utf-8'): :arg patt: The regex pattern to search. Any standard Python `regular expression `_ - is accepted. + is accepted. The `re.MULTILINE + `_ flag + is used for the pattern search. + :arg filename: The name of the file to examine. Any :class:`OSError` raised while processing the file will be propagated as a :class:`reframe.core.exceptions.SanityError`. @@ -502,7 +505,9 @@ def findall(patt, filename, encoding='utf-8'): :arg patt: The regex pattern to search. Any standard Python `regular expression `_ - is accepted. + is accepted. The `re.MULTILINE + `_ flag + is used for the pattern search. :arg filename: The name of the file to examine. :arg encoding: The name of the encoding used to decode the file. :returns: A list of raw `regex match objects @@ -555,7 +560,9 @@ def extractall(patt, filename, tag=0, conv=None, encoding='utf-8'): :arg patt: The regex pattern to search. Any standard Python `regular expression `_ - is accepted. + is accepted. The `re.MULTILINE + `_ flag + is used for the pattern search. :arg filename: The name of the file to examine. :arg encoding: The name of the encoding used to decode the file. :arg tag: The regex capturing group to be extracted. @@ -589,7 +596,6 @@ def extractsingle(patt, filename, tag=0, conv=None, item=0, encoding='utf-8'): :arg item: the specific element to extract. :returns: The extracted value. :raises reframe.core.exceptions.SanityError: In case of errors. - ''' try: # Explicitly evaluate the expression here, so as to force any exception From 59fb5ae7535ca3c298bad8e743d03bbf6c42482c Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Thu, 16 Jul 2020 15:21:18 +0200 Subject: [PATCH 2/2] Address PR comments --- reframe/utility/sanity.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/reframe/utility/sanity.py b/reframe/utility/sanity.py index 75f101568d..0f8ec8d82b 100644 --- a/reframe/utility/sanity.py +++ b/reframe/utility/sanity.py @@ -362,9 +362,10 @@ def assert_found(patt, filename, msg=None, encoding='utf-8'): :arg patt: The regex pattern to search. Any standard Python `regular expression `_ - is accepted. The `re.MULTILINE + is accepted. + The `re.MULTILINE `_ flag - is used for the pattern search. + is set for the pattern search. :arg filename: The name of the file to examine. Any :class:`OSError` raised while processing the file will be @@ -505,9 +506,10 @@ def findall(patt, filename, encoding='utf-8'): :arg patt: The regex pattern to search. Any standard Python `regular expression `_ - is accepted. The `re.MULTILINE + is accepted. + The `re.MULTILINE `_ flag - is used for the pattern search. + is set for the pattern search. :arg filename: The name of the file to examine. :arg encoding: The name of the encoding used to decode the file. :returns: A list of raw `regex match objects @@ -560,9 +562,10 @@ def extractall(patt, filename, tag=0, conv=None, encoding='utf-8'): :arg patt: The regex pattern to search. Any standard Python `regular expression `_ - is accepted. The `re.MULTILINE + is accepted. + The `re.MULTILINE `_ flag - is used for the pattern search. + is set for the pattern search. :arg filename: The name of the file to examine. :arg encoding: The name of the encoding used to decode the file. :arg tag: The regex capturing group to be extracted.