Hello
I searched the tutorial and reference section but could not find anything about this.
I would like to be able to run a single section - meaning execute all 'parent' sections and don't execute the child sections.
My usecase is, that I setup the test data and test different things on the same setup. Once a test fails I need to fix that test, but if all sections are executed it is cumbersome to use breakpoints as most have to be skipped until the section of interest.
If there is a better test setup, please tell me.
Thank you!
Maybe it could be possible to make one test/section explicitly to be executed. I've tried to do this with add a tag, but it looks like that tags are only sampled at the highes level?
Yes ist seems that Tags are only applied to TEST_CASE but not SECTION, Tags would be a great way to implement my Request.
I agree.
Should not the definition of a 'test' be any block from within which you enter the codebase you're testing? So if you can run main(), object.do() or whatever in a SECTION then so too should you be able to isolate execution of that test.
I would actually argue that without this TDD is, by principle, not possible.
This has been a long standing and common (and understandable) request.
There are some problems with it that mean there is no ideal solution, but the basic principle of "only go into sections that I have specified" is possible - and indeed I have now implemented this on a locally branch and am testing it out!
The mechanism is via a new command line option, --section or -c. Each time you use this you can follow it with a section name, so for nested sections use multiple options. This is not terribly convenient for writing by hand (at least not with long section names), but at least gets us the first step of making it possible (and it turns out to be really useful for machine consumption - i.e. by test runner tools).
It doesn't currently support wildcards or tags - but I'll look at adding those later.
I'll be pushing - probably to a branch to begin with - soon.
This has shown up many times over the time, so I am linking some duplicates I found: #110, #276
Do we have an ETA for the release of this feature?
@ruipacheco Partial support is in, see current release notes, or CLI documentation.
While more could be done, I believe the feature that is in (with -c) is sufficient to close this ticket now (reopen if you disagree).
Most helpful comment
This has been a long standing and common (and understandable) request.
There are some problems with it that mean there is no ideal solution, but the basic principle of "only go into sections that I have specified" is possible - and indeed I have now implemented this on a locally branch and am testing it out!
The mechanism is via a new command line option,
--sectionor-c. Each time you use this you can follow it with a section name, so for nested sections use multiple options. This is not terribly convenient for writing by hand (at least not with long section names), but at least gets us the first step of making it possible (and it turns out to be really useful for machine consumption - i.e. by test runner tools).It doesn't currently support wildcards or tags - but I'll look at adding those later.
I'll be pushing - probably to a branch to begin with - soon.