Skip to content

Commit 4db93ca

Browse files
committed
Make error message when embedding version test fails more friendly
1 parent f38d28a commit 4db93ca

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎testing/cffi0/test_version.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,8 @@ def test_embedding_h():
5959
v = cffi.__version__
6060
p = cffi_root / 'src/cffi/_embedding.h'
6161
content = _read(p)
62-
assert ('cffi version: %s"' % (v,)) in content
62+
loc = content.find('cffi version: ')
63+
assert loc > 0, "Cannot find cffi version string in _embedding.h"
64+
context = content[loc-100:loc+100]
65+
msg = f"CFFI verison is incorrect, context for current version string is:\n{context}"
66+
assert (f'cffi version: {v}"') in context, msg

0 commit comments

Comments
 (0)