Fix log error parsing bug introduced in c830eda0e (#5387)

- '\b' in regular expression needs to be in a raw string (r'\b')
- Regression test that would've caught this was unintentionally disabled

- This fixes the string and the test
This commit is contained in:
Todd Gamblin
2017-09-17 15:31:32 -07:00
committed by GitHub
parent 2d22a88a96
commit eb0ea7697a
3 changed files with 52 additions and 3 deletions

View File

@@ -114,8 +114,8 @@ def test_package_output(tmpdir, capsys, install_mockery, mock_fetch):
assert "'install'\nAFTER INSTALL" in out
def _test_install_output_on_build_error(builtin_mock, mock_archive, mock_fetch,
config, install_mockery, capfd):
def test_install_output_on_build_error(builtin_mock, mock_archive, mock_fetch,
config, install_mockery, capfd):
# capfd interferes with Spack's capturing
with capfd.disabled():
out = install('build-error', fail_on_error=False)

View File

@@ -86,7 +86,7 @@ def parse_log_events(logfile, context=6):
log_events = []
for i, line in enumerate(lines):
if re.search('\berror:', line, re.IGNORECASE):
if re.search(r'\berror:', line, re.IGNORECASE):
event = LogEvent(
line.strip(),
i + 1,