Skip to content

Make test_parsing more resilient to changes in pycparser#224

Merged
mattip merged 2 commits into
python-cffi:mainfrom
eliben:fix-test-pycparser
Jan 25, 2026
Merged

Make test_parsing more resilient to changes in pycparser#224
mattip merged 2 commits into
python-cffi:mainfrom
eliben:fix-test-pycparser

Conversation

@eliben

@eliben eliben commented Jan 24, 2026

Copy link
Copy Markdown
Contributor

Several tests expect precise error messages from pycparser, which pycparser doesn't guarantee. While testing CFFI with pycparser 3.0, some tests needed to be made more resilient. I've used the .startswith() approach already used in this file, instead of exact string matching.

Ref #223

Several tests expect precise error messages from pycparser, which pycparser
doesn't guarantee. While testing CFFI with pycparser 3.0, some tests needed
to be made more resilient. I've used the .startswith() approach already used
in this file, instead of exact string matching.

Ref python-cffi#223
@eliben

eliben commented Jan 24, 2026

Copy link
Copy Markdown
Contributor Author

The only failing CI check (https://github.com/python-cffi/cffi/actions/runs/21318284561/job/61364325190?pr=224) seems to be pulling pycparser 2.23 instead of the new 3.00; I'm not sure why, this is probably specific to how this check is set up?

It would be possible to make the failing test even more resilient - succeeding on both pycparser 2.23 and 3.00; I can amend the PR to do that, if you're interested.

Alternatively, the check can be fixed to pull the newest pycparser - like all the other CI checks.

@mattip

mattip commented Jan 24, 2026

Copy link
Copy Markdown
Contributor

If possible loosening the error checking specificity to accommodate both versions would be great

@eliben

eliben commented Jan 24, 2026

Copy link
Copy Markdown
Contributor Author

If possible loosening the error checking specificity to accommodate both versions would be great

Thank you for the quick review.

Done - all CI checks pass now.

@mattip mattip merged commit c36c02f into python-cffi:main Jan 25, 2026
37 checks passed
@mattip

mattip commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

Thanks @eliben

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants