Improve LaTeX skip decorators

This commit is contained in:
Adam Turner
2025-02-11 01:49:14 +00:00
parent baddae6611
commit b81a7d7477

View File

@@ -77,20 +77,14 @@ def compile_latex_document(app, filename='projectnamenotset.tex', docclass='manu
raise AssertionError(msg) from exc raise AssertionError(msg) from exc
def skip_if_requested(testfunc): skip_if_requested = pytest.mark.skipif(
if 'SKIP_LATEX_BUILD' in os.environ: 'SKIP_LATEX_BUILD' in os.environ,
msg = 'Skip LaTeX builds because SKIP_LATEX_BUILD is set' reason='Skip LaTeX builds because SKIP_LATEX_BUILD is set',
return pytest.mark.skipif(True, reason=msg)(testfunc) )
else: skip_if_stylefiles_notfound = pytest.mark.skipif(
return testfunc not kpsetest(*STYLEFILES),
reason='not running latex, the required styles do not seem to be installed',
)
def skip_if_stylefiles_notfound(testfunc):
if kpsetest(*STYLEFILES) is False:
msg = 'not running latex, the required styles do not seem to be installed'
return pytest.mark.skipif(True, reason=msg)(testfunc)
else:
return testfunc
class RemoteImageHandler(http.server.BaseHTTPRequestHandler): class RemoteImageHandler(http.server.BaseHTTPRequestHandler):