◐ Shell
clean mode source ↗

gh-104683: Rename clinic.test => clinic.test.c by erlend-aasland · Pull Request #106443 · python/cpython

AlexWaygood

@AlexWaygood

Might be worth backporting this; it'll reduce the risk of merge conflicts in future backport PRs

@miss-islington

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Jul 5, 2023

@bedevere-bot

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Jul 5, 2023

@bedevere-bot

AlexWaygood pushed a commit that referenced this pull request

Jul 5, 2023

AlexWaygood pushed a commit that referenced this pull request

Jul 5, 2023

carljm added a commit to carljm/cpython that referenced this pull request

Jul 5, 2023

@serhiy-storchaka

I intentionally made this file having extension different from .c, so clinic.py --make will not regenerate it.

It makes regenerating it inconvenient, but on other hand, it prevents unintentional regeneration. Otherwise the breaking changes in clinic.py can pass unnoticed, because make clinic is ran before clinic tests.

@erlend-aasland

There was consensus on the core dev Discord for this change.

@erlend-aasland

Ideally, I would like to get rid of clinic.test.c, and move all those test to _testclinic.c, to make sure the generated code actually works as expected in Python.

@erlend-aasland

It makes regenerating it inconvenient, but on other hand, it prevents unintentional regeneration. Otherwise the breaking changes in clinic.py can pass unnoticed, because make clinic is ran before clinic tests.

IMO, a better option is to add an --exclude option to the clinic CLI and explicitly exclude that file when running make clinic.

@erlend-aasland

See #107770 for my suggestion to preserve make clinic behaviour.

@serhiy-storchaka

Initially I introduced Lib/test/clinic.test as a temporary solution, because I was not very familiar with the AC code and did not know how to use it programmatically to generate only an interesting part of output (I still does not know this). clinic.test contains a lot of generated noise unrelated to a purpose of specific test. For example all these ugly struct initializers for _kwtuple and _parser take too much space.

My hope is that someday someone (maybe you, maybe me) will turn most or all of these tests into proper unit tests.

@erlend-aasland

It sounds to me that your intention harmonises with my desire to turn clinic.test.c into functional tests. So we agree, I think.