Skip to content

Commit

Permalink
test: fix error message filename removal on macOS
Browse files Browse the repository at this point in the history
For some reason there's a /private prefix in the error messages on macOS
that's not present in srcdir, nor on Linux. Just remove everything
before and including the srcdir.
  • Loading branch information
jnikula committed Aug 31, 2024
1 parent 3a377b4 commit a63fae4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_cautodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _sphinx_build(self, srcdir):
output_filename = os.path.join(app.outdir, f'index.{output_suffix}')

# Remove paths from warning output for comparison
output_errors = re.sub(rf'(?m)^{srcdir}/index.rst:[0-9]+: ([^:]*: )(/[a-zA-Z0-9._-]+)*/',
output_errors = re.sub(rf'(?m)^.*{srcdir}/index.rst:[0-9]+: ([^:]*: )(/[a-zA-Z0-9._-]+)*/',
'\\1', warning.getvalue())

return testenv.read_file(output_filename), output_errors
Expand Down

0 comments on commit a63fae4

Please sign in to comment.