pytest-given Self-Report
pytest 9.2.0 pytest-given 0.5.2
Module:
pytest-given report --report-url re-renders a saved report for another URL
✓ passed 121ms
Given
a saved report served from /dev/
When
it is re-rendered with --report-url set to /1.0/
Then
the command succeeds
the copy buttons' citations link the /1.0/ URL
The citations exit code says whether a citation finding remains, so CI can gate on it
✓ passed 16ms
Given
a document with a citation that is {citation}
document
a JSON report that is {report_state}
When
pytest-given citations {command} runs on the document
Then
it exits {exit_code}
the document was rewritten: {rewritten}
citation document report_state command exit_code rewritten
current readable check 0 False
document
✅ [Pay by card](https://example.org/report.html#scenario=t.py::test_pay)
stale readable check 1 False
document
✓ [old](https://example.org/report.html#scenario=t.py::test_pay)
stale readable update 0 True
document
✓ [old](https://example.org/report.html#scenario=t.py::test_pay)
of a gone scenario readable update 1 True
document
✅ [Gone](https://example.org/report.html#scenario=t.py::test_gone)
stale unreadable update 2 False
document
✓ [old](https://example.org/report.html#scenario=t.py::test_pay)
citations refuses documents that never link the report, rather than passing them
✓ passed 2ms
Given
a document whose citation links another URL
✅ [Pay by card](https://example.org/dev/report.html#scenario=t.py::test_pay)
a JSON report served from https://example.org/report.html
When
pytest-given citations check runs on the document
Then
it exits 2, as for a report it cannot read
the error names the URL it looked for
Without --report, citations reads the JSON report a bare --given-json writes
✓ passed 4ms
Given
a JSON report at given-report/report-data.json
a document with a stale citation
✓ [old](https://example.org/report.html#scenario=t.py::test_pay)
When
pytest-given citations update runs on it without --report
Then
it exits 0
the citation reads what that report says
citations check --list prints every report link, its findings under it
✓ passed 2ms
Given
a document with two citations, one of them stale, and a plain report link
# Paying
✅ [Pay by card](https://example.org/report.html#scenario=t.py::test_pay) and ✓ [Refund](https://example.org/report.html#scenario=t.py::test_refund)
See [refunds](https://example.org/report.html#scenario=t.py::test_refund) and [elsewhere](https://other.org/)
a JSON report of its scenarios
When
pytest-given citations check --list runs on the document
docs/spec.md:2: ✅ scenario t.py::test_pay
docs/spec.md:2: ✓ scenario t.py::test_refund
    stale glyph
        ✓ → ✅
docs/spec.md:3: link scenario t.py::test_refund
citations: 1 finding; `citations update` fixes 1
Then
each report link is a line, with each finding indented under its own
it exits 1 for the finding
--covering leaves report links out of the list but still counts their findings
✓ passed 2ms
Given
a document whose stale citation cites test_refund, not test_pay
# Paying
✅ [Pay by card](https://example.org/report.html#scenario=t.py::test_pay) and ✓ [Refund](https://example.org/report.html#scenario=t.py::test_refund)
See [refunds](https://example.org/report.html#scenario=t.py::test_refund) and [elsewhere](https://other.org/)
a JSON report of its scenarios
When
pytest-given citations check --covering names test_pay
docs/spec.md:2: ✅ scenario t.py::test_pay
citations: 1 finding, 1 of them left out by --covering; `citations update` fixes 1
Then
only the citation of test_pay is listed
the summary counts the finding it left out
it exits 1 for that finding
A scenario reaches the report with its tags and term refs
✓ passed 64ms
Given
a scenario with a tag, whose step names a glossary term
from pytest_given import Glossary, scenario, given, when, then

g = Glossary()
guest = g.actor('Guest')

@scenario("Check in", tags=["smoke"])
def test_check_in():
    with given(t"a {guest} at the desk"):
        keys = 0
    with when("the desk hands over a key"):
        keys += 1
    with then("the guest holds one key"):
        assert keys == 1
When
the suite runs with --given-json
Then
the test passes
the scenario carries its title, its tag and its three steps
the given step holds a term ref to the term
A chained failure reports the frames of its own error, and its cause apart
✓ passed 103ms
Given
a scenario failing through a cause
When
the suite fails and the report is written
Then
the error's frames hold the line that raised it
the cause is reported apart, with the sentence leading on to the error
A scenario failing on a pytest-given refusal points at the test, not at pytest-given
✓ passed 71ms
Given
a suite that nests across phases and mistypes a term
    from pytest_given import Glossary, given, scenario, when

    g = Glossary()
    g.actor('Guest')

    @scenario('nested across phases')
    def test_nest():
        with given('a machine'):
            with when('it brews'):
                pass

    @scenario('a mistyped term')
    def test_lookup():
        with given('a guest'):
            g['Gust']
When
the suite runs with --given-json
Then
both scenarios fail
each failure ends on its own test function
A test without @scenario stays out of the report
✓ passed 60ms
Given
a suite whose only test is undecorated
When
the suite runs with --given-json
Then
the test itself passes
the report holds no scenario
A step fixture is grafted in as a given step
✓ passed 61ms
Given
a scenario consuming a step fixture
import pytest
from pytest_given import scenario, given, then

@pytest.fixture
@given("a prepared value")
def value():
    return 42

@scenario("Fixture test")
def test_fixture(value):
    with then(f"value is {value}"):
        assert value == 42
When
the suite runs with --given-json
Then
the test passes
the step from the fixture leads the recorded steps
A scenario is timed from past its step fixture setup
✓ passed 560ms
Given
a scenario whose step fixture takes half a second
import time
import pytest
from pytest_given import scenario, given, then

@pytest.fixture
@given("a slow arrangement")
def slow():
    time.sleep(0.5)
    return 1

@scenario("Quick body")
def test_quick(slow):
    with then("it is one"):
        assert slow == 1
When
the suite runs with --given-json
Then
the test passes
the recorded duration leaves out the half second of setup
The cases of a parametrized scenario become one scenario with a parameter table
✓ passed 59ms
Given
a parametrized scenario over two cases
import pytest
from pytest_given import scenario, given, when, then

@scenario("Param test", tags=["math"])
@pytest.mark.parametrize("a,b,expected", [(1, 2, 3), (2, 3, 5)])
def test_add(a, b, expected):
    with given(t"a={a} and b={b}"):
        pass
    with then(t"sum is {expected}"):
        assert a + b == expected
When
the suite runs with --given-json
Then
both cases pass
the two runs collapse into one scenario
the parameter table holds a param column per argument
it holds one row per case, with that row's values
the grouped steps carry a placeholder per matching name
A parameter table names its rows by their case IDs when any is custom
✓ passed 109ms
Given
a parametrized scenario whose first case is written {first_case}, the other left to pytest
When
the suite runs with --given-md
Then
both cases pass
the parameter table case ID column is {id_column}
a shown column puts the custom case ID beside the generated one
first_case id_column
pytest.param(20, False, id="touching-edges") shown
(20, False) omitted
A refusal on a run that writes no report does not claim one was skipped
✓ passed 29ms
Given
a suite whose narration varies across parametrize cases
When
the suite runs with no --given-* output flag
Then
the refusal is reported without claiming a report was skipped
A refused run discards the previous run's report
✓ passed 29ms
Given
a suite whose narration varies across parametrize cases
import pytest
from pytest_given import scenario, when

@scenario("Brew")
@pytest.mark.parametrize("cup_size", [200, 350])
def test_brew(cup_size):
    with when(f"it brews {cup_size} ml"):
        assert cup_size > 0
a report on disk from a previous run
When
the suite runs with those output flags
Then
the run says no report was written, naming the file
the stale files are gone rather than left reading as current
A source link value that cannot work stops the run before it collects
✓ passed 26ms
Given
a suite that would otherwise pass
from pytest_given import scenario, then

@scenario("Brew")
def test_brew():
    with then("it brews"):
        assert True
When
the suite runs with --given-source-link={value}
Then
the run ends as a usage error, saying {error}
no test ran
case ID value error
misspelled-preset bogus Unknown --given-source-link preset
unknown-variable {bogus} Unknown source-link template variable
An unknown source link preset in an ini reports the ini name
✓ passed 11ms
Given
a suite configured through the ini rather than the flag
When
the suite runs with an HTML report
Then
the error names the ini setting, not a flag the user never typed
A report that fails to render leaves no report behind, not even the previous one
✓ passed 34ms
Given
a suite with one scenario
a report pair on disk from a previous run
When
the run trips a renderer failure
Then
the run fails, saying no report was written
neither the stale pair nor a half-written new one survives
A fixture failing in teardown fails its finished scenario
✓ passed 59ms
Given
a scenario whose fixture raises after its yield
import pytest
from pytest_given import scenario, given, then

@pytest.fixture
def resource():
    yield 1
    raise RuntimeError("teardown boom")

@scenario("Teardown-failed")
def test_a(resource):
    with given("a resource"):
        value = resource
    with then("it is one"):
        assert value == 1
When
the suite runs with --given-json
Then
pytest counts the test passed and its teardown an error
the report marks the scenario failed with the teardown error
A step fixture refuses steps and attachments in its teardown
✓ passed 77ms
Given
a step fixture that adds a {late} after its yield
suite
When
the suite runs
Then
the test passes but its teardown errors with a PytestGivenError
late suite
step
suite
import pytest
from pytest_given import scenario, given, then, attach

@pytest.fixture
@given("a thing")
def thing():
    yield 1
    with given("a late step"): pass

@scenario("Teardown raises")
def test_use(thing):
    with then("it is one"):
        assert thing == 1
attachment
suite
import pytest
from pytest_given import scenario, given, then, attach

@pytest.fixture
@given("a thing")
def thing():
    yield 1
    attach("late", "data")

@scenario("Teardown raises")
def test_use(thing):
    with then("it is one"):
        assert thing == 1
A fixture takes only @given, never @when or @then
✓ passed 70ms
Given
a fixture decorated with @{decorator}
suite
When
the suite runs
Then
a PytestGivenError points at @given
decorator suite
when
suite
import pytest
from pytest_given import scenario, then, when

@pytest.fixture
@when("a coin is inserted")
def coin():
    return 2

@scenario("uses the fixture")
def test_use(coin):
    with then("the coin is 2"):
        assert coin == 2
then
suite
import pytest
from pytest_given import scenario, then, then

@pytest.fixture
@then("a coin is inserted")
def coin():
    return 2

@scenario("uses the fixture")
def test_use(coin):
    with then("the coin is 2"):
        assert coin == 2
A scenario that fails as expected keeps its steps, error and reason under its own status
✓ passed 59ms
Given
a scenario marked xfail whose body fails
import pytest
from pytest_given import scenario, given, then

@scenario("Planned")
@pytest.mark.xfail(reason="not implemented yet")
def test_planned():
    with given("a value"):
        value = 1
    with then("it is two"):
        assert value == 2
When
the suite runs with --given-json
Then
pytest counts the test xfailed
the report marks the scenario xfailed with its reason, its steps and the error that broke it
An editor source link opens the file under the rootdir, wherever pytest runs from
✓ passed 170ms
Given
a suite whose test sits in a subdirectory, run from inside it
When
the HTML report renders with the vscode preset
Then
the link names the test file's path from the rootdir
A scenario is matched against each of its stories
✓ passed 61ms
Given
a scenario binding two stories whose sentence its narration fits
from pytest_given import Glossary, scenario, sentence, story, when

g = Glossary()
guest = g.actor('Guest')
search = g.activity('search')
room = g.work_object('Room')
a = story('Book', [sentence(guest, search, room)])
b = story('Stay', [sentence(guest, search, room)])

@scenario('both', stories=[a, b])
def test_both():
    with when(t'the {guest} does a {search} for a {room}'):
        pass
When
the suite runs with --given-json
Then
the test passes
the scenario binds both stories and covers the sentence of each
A declared story appears in the report even when no scenario covers it
✓ passed 64ms
Given
a suite declaring a story that no scenario names or pins
from pytest_given import Glossary, given, scenario, sentence, story

g = Glossary()
guest = g.actor('Guest')
search = g.activity('search')
room = g.work_object('Room')
story('Unread', [sentence(guest, search, room)])

@scenario('x')
def test_x():
    with given('something'):
        pass
When
the suite runs with --given-json
Then
the report lists the story, its sentence covered by nothing
A pinned scenario still counts its step pins
✓ passed 68ms
Given
a scenario pinning one sentence, whose steps pin a second and narrate a third
from pytest_given import Glossary, given, scenario, sentence, story

g = Glossary()
guest = g.actor('Guest')
search = g.activity('search')
room = g.work_object('Room')
s = story('Book', [
    sentence(guest('Alice'), search, room),
    sentence(guest('Bob'), search, room),
    sentence(guest, search, room)])

@scenario('x', stories=s, pins=s[1])
def test_x():
    with given('a pinned step', pins=s[2]):
        pass
    with given(t'the {guest} does a {search} for a {room}'):
        pass
When
the suite runs with --given-json
Then
the scenario covers both pinned sentences and not the one its narration would match
A step pin into a story outside stories= covers it
✓ passed 63ms
Given
a step pinning a story its scenario does not name
from pytest_given import Glossary, given, scenario, sentence, story

g = Glossary()
guest = g.actor('Guest')
search = g.activity('search')
room = g.work_object('Room')
a = story('Book', [sentence(guest, search, room)])
b = story('Stay', [sentence(guest, search, room)])

@scenario('x', stories=a)
def test_x():
    with given('thing', pins=b[1]):
        pass
When
the suite runs with --given-json
Then
the scenario passes and covers the pinned sentence, in the story it did not name
A wide fixture recording keeps its pins in every scenario it is grafted into
✓ passed 65ms
Given
a module-scoped step fixture pinning a sentence, set up first by an unannotated test
import pytest
from pytest_given import Glossary, given, scenario, sentence, story

g = Glossary()
guest = g.actor('Guest')
search = g.activity('search')
room = g.work_object('Room')
a = story('Book', [sentence(guest, search, room)])
b = story('Stay', [sentence(guest, search, room)])

@pytest.fixture(scope='module')
@given('a module-scoped arrangement')
def wide():
    with given('an inner step', pins=a[1]):
        pass
    yield 1

def test_unannotated(wide):
    assert wide == 1

@scenario('first', stories=a)
def test_first(wide):
    pass

@scenario('second', stories=b)
def test_second(wide):
    pass
When
the suite runs with --given-json
Then
every test passes, and both scenarios cover the pinned sentence, whichever story they name
A given annotation's pin lands on the step it adds
✓ passed 62ms
Given
a scenario whose given annotation on a plain fixture carries a pin
from typing import Annotated
import pytest
from pytest_given import Glossary, given, scenario, sentence, story

g = Glossary()
guest = g.actor('Guest')
search = g.activity('search')
room = g.work_object('Room')
s = story('Book', [sentence(guest, search, room)])

@pytest.fixture
def room_number():
    return 7

@scenario('x', stories=s)
def test_x(room_number: Annotated[int, given('a room', pins=s[1])]):
    pass
When
the suite runs
Then
the annotation's step carries the pin
A given annotation retells the pins of the step fixture label it replaces
✓ passed 185ms
Given
a story a, and a given annotation with pins={annotation_pins} over a step fixture pinning a[1]
suite
When
the suite runs
Then
the grafted root pins the sentences {root_sentences} of a
the inner step keeps its own pin, a[3]
case ID annotation_pins suite root_sentences
none-keeps None [1]
suite
from typing import Annotated
import pytest
from pytest_given import Glossary, given, scenario, sentence, story

g = Glossary()
guest = g.actor('Guest')
search = g.activity('search')
room = g.work_object('Room')
a = story('Book', [
    sentence(guest, search, room),
    sentence(guest('Alice'), search, room),
    sentence(guest('Bob'), search, room)])

@pytest.fixture
@given('a fixture label', pins=a[1])
def arranged():
    with given('an inner step', pins=a[3]):
        pass
    return 1

@scenario('x', stories=a)
def test_x(
    arranged: Annotated[
        int, given('a retold label', pins=None)
    ],
):
    pass
empty-clears [] []
suite
from typing import Annotated
import pytest
from pytest_given import Glossary, given, scenario, sentence, story

g = Glossary()
guest = g.actor('Guest')
search = g.activity('search')
room = g.work_object('Room')
a = story('Book', [
    sentence(guest, search, room),
    sentence(guest('Alice'), search, room),
    sentence(guest('Bob'), search, room)])

@pytest.fixture
@given('a fixture label', pins=a[1])
def arranged():
    with given('an inner step', pins=a[3]):
        pass
    return 1

@scenario('x', stories=a)
def test_x(
    arranged: Annotated[
        int, given('a retold label', pins=[])
    ],
):
    pass
list-replaces [a[2]] [2]
suite
from typing import Annotated
import pytest
from pytest_given import Glossary, given, scenario, sentence, story

g = Glossary()
guest = g.actor('Guest')
search = g.activity('search')
room = g.work_object('Room')
a = story('Book', [
    sentence(guest, search, room),
    sentence(guest('Alice'), search, room),
    sentence(guest('Bob'), search, room)])

@pytest.fixture
@given('a fixture label', pins=a[1])
def arranged():
    with given('an inner step', pins=a[3]):
        pass
    return 1

@scenario('x', stories=a)
def test_x(
    arranged: Annotated[
        int, given('a retold label', pins=[a[2]])
    ],
):
    pass
A plugin registered from a conftest warns instead of degrading silently
✓ passed 60ms
Given
a scenario and a conftest that registers the plugin
When
the suite runs with plugin autoload disabled
Then
the run passes and the report is still written
the scenario keeps its rootdir-relative source
pytest's warnings summary says it loaded too late to prepare capture
A Template given annotation on an unparametrized scenario fails that scenario
✓ passed 112ms
Given
a Template given annotation on a plain fixture parameter
from typing import Annotated
import pytest
from pytest_given import scenario, given, when, Template

@pytest.fixture
def room():
    return 101

@scenario('a room is booked')
def test_it(room: Annotated[int, given(Template('room {room} is free'))]):
    with when('it is booked'):
        pass
When
the suite runs with an HTML report
Then
the scenario errors, naming the parameter and the fix
the HTML report is still written
A Template given annotation may only hold a bare parametrize column
✓ passed 105ms
Given
a parametrized scenario over x, with a plain fixture room whose Template given annotation holds {placeholder}
suite
When
the suite runs
Then
the scenario errors, saying {error}
case ID placeholder suite error
plain-fixture {room} '{room}' in the given annotation on parameter 'room' does not match any parametrize column (have: ['x']). A given annotation reads only parametrize columns, not fixture values. To show a fixture value, narrate it in a t-string in the test body.
suite
from typing import Annotated
import pytest
from pytest_given import scenario, given, when, Template

@pytest.fixture
def room():
    return 101

@scenario('Booking a room')
@pytest.mark.parametrize('x', [1])
def test_it(x, room: Annotated[int, given(Template('room {room}'))]):
    with when('it is booked'):
        pass
attribute {room.number} only supports bare identifiers as placeholders; got 'room.number'
suite
from typing import Annotated
import pytest
from pytest_given import scenario, given, when, Template

@pytest.fixture
def room():
    return 101

@scenario('Booking a room')
@pytest.mark.parametrize('x', [1])
def test_it(x, room: Annotated[int, given(Template('room {room.number}'))]):
    with when('it is booked'):
        pass
A bare run writes no report at all
✓ passed 29ms
Given
a suite with one scenario
    import pytest
    from pytest_given import scenario, given, when, then

    @scenario('Buy coffee')
    def test_buy():
        with given('a machine'):
            pass
        with when('I insert money'):
            pass
        with then('I get coffee'):
            assert True
When
the suite runs with no output flag
Then
the run passes
no report directory appears in the default location
A bare --given-md prints the narration to stdout
✓ passed 56ms
Given
a suite with one scenario
When
the suite runs with a bare --given-md
Then
the narration is printed between the fence markers
A report is not written over by a run that runs no tests
✓ passed 256ms
Given
a suite with one scenario and its written report
When
the suite runs again with {mode}
Then
the run passes
the report on disk is still the one the real run wrote
the summary says no report was written, because {reason}
mode reason
--collect-only a --collect-only run runs no tests
--setup-only a --setup-only run stops before the tests
--setup-plan a --setup-plan run plans setup but runs no tests
The Markdown report leaves the line out of each scenario anchor under given_md_lines = false
✓ passed 54ms
Given
a suite with one scenario, and given_md_lines = false
When
the suite runs with --given-md
Then
the anchor is the node ID, without a line number
--given-md-source ends each scenario of the Markdown report with its test function, under its line numbers
✓ passed 60ms
Given
a suite with one scenario
When
the suite runs with --given-md and --given-md-source
Then
the narration is followed by the test function, decorator included, each line numbered as in the file
# pytest-given — test_given_md_source_shows_the_test_function0

## ✓ Buy coffee
`test_given_md_source_shows_the_test_function.py:4::test_buy`

- **given** a machine
- **when** I insert money
- **then** I get coffee

```python
 4  @scenario('Buy coffee')
 5  def test_buy():
 6      with given('a machine'):
 7          pass
 8      with when('I insert money'):
 9          pass
10      with then('I get coffee'):
11          assert True
```
--given-html alone writes no JSON report
✓ passed 96ms
Given
a suite with one scenario
When
the suite runs with --given-html alone
Then
the HTML rendering is written
no JSON lands in the default location
An output flag pointed at a source file is refused before the suite runs
✓ passed 13ms
Given
a suite with one scenario
When
a bare --given-html swallows the test path that follows it
Then
the run is refused, naming the path and the flag-order fix
the source file is left exactly as it was, not overwritten
A rejected authoring form fails the run and writes no report
✓ passed 31ms
Given
a suite whose narration varies across parametrize cases
import pytest
from pytest_given import scenario, when

@pytest.mark.parametrize('cup_size', [200, 350])
@scenario('Brew')
def test_brew(cup_size):
    with when(f'the machine brews {cup_size} ml'):
        pass
When
the suite runs with all three output flags
Then
the run fails, naming the offending form
not one report file is written, and no traceback escapes
--given-title names the report instead of the rootdir
✓ passed 61ms
Given
a suite with one scenario
When
the suite runs with --given-title
Then
the test passes
the title reaches the JSON metadata
the title also heads the Markdown rendering
--given-theme sets the theme the HTML report opens in
✓ passed 174ms
Given
a suite with one scenario
When
the suite runs with --given-theme=dark
Then
the test passes
the page declares dark as its default theme
Under pytest-xdist, a run that writes a report or runs the narration lint stops before it collects
✓ passed 641ms
Given
a suite that would otherwise pass
When
the suite runs on {workers} xdist workers with {option}
Then
it exits {exit_code}
the suite ran: {ran}
case ID workers option exit_code ran
report 2 --given-json=report.json 4 False
lint 2 --given-lint 4 False
neither 2 --no-given-lint 0 True
serial-report 0 --given-json=report.json 0 True
A Markdown report printed to stdout is UTF-8, whatever the console's code page
✓ passed 411ms
Given
a suite that passes
a console whose code page is cp1252, which has no status glyphs
When
the suite runs with a bare --given-md, in its own process
Then
the scenario heading carries its ✓ glyph, not an escape
An unknown theme stops the run before it collects
✓ passed 17ms
Given
a suite that would otherwise pass
When
the suite runs with a misspelled theme, and no HTML report
Then
the run ends as a usage error, naming the flag the user typed
no test ran
A parametrized scenario can decline the grouping and keep one scenario per case
✓ passed 71ms
Given
a parametrized scenario over two cases that declines the grouping
import pytest
from pytest_given import scenario, then, Template

@scenario(Template('Brew {cup_size} ml'), group_parametrized=False)
@pytest.mark.parametrize('cup_size', [200, 300])
def test_brew(cup_size):
    with then('it brews'):
        assert cup_size
When
the suite runs with --given-json
Then
both cases pass
each case is its own scenario, titled with its id, with no parameter table
A run that writes no report still enforces the grouping rules
✓ passed 32ms
Given
a suite whose f-string narration records no parts
import pytest
from pytest_given import scenario, then

@scenario("Brew")
@pytest.mark.parametrize('cup_size', [200, 300])
def test_brew(cup_size):
    with then(f'it brews {cup_size} ml'):
        assert cup_size
When
the suite runs with no output flag
Then
the run still fails, naming the offending form
Every scenario carries the pytest_given marker
✓ passed 34ms
Given
a suite with a scenario, a parametrized scenario and a plain test
import pytest
from pytest_given import scenario, then

@scenario("Brew")
def test_brew():
    with then("it brews"):
        assert True

@scenario("Pour")
@pytest.mark.parametrize('cup_size', [200, 350])
def test_pour(cup_size):
    with then(t"it pours {cup_size} ml"):
        assert cup_size

def test_plain():
    assert True
When
the suite runs with -m pytest_given
Then
the scenario and every case run
the plain test is deselected
A file glossary's kindless terms reach the report with the kinds the run infers
✓ passed 483ms
Given
a file glossary of kindless terms and a story whose sentence uses them
# Glossary

| Term | Meaning |
|------|---------|
| Guest  | A person booking. |
| Room   | A bookable room. |
| search | Look up options. |
from pytest_given import scenario, when, story, sentence
from conftest import g

book = story('Book a room', [sentence(g['Guest'], g['search'], g['Room'])])


@scenario('Guest searches', stories=book)
def test_guest_searches():
    with when(t'{g["Guest"]} {g["search"]("searches for")} a {g["Room"]}'):
        pass
When
the suite runs with --given-json
Then
the scenario passes
each term in the report takes the kind of its slot: actor, activity, object
Narration lint is off unless it is asked for
✓ passed 40ms
Given
a suite with one flawed step
from pytest_given import scenario, given, when, then

@scenario("Empty given")
def test_empty_given():
    with given("a value"):
        pass
    with when("computing"):
        x = 2
    with then("it is two"):
        assert x == 2
When
the suite runs without the lint flag
Then
the run passes and says nothing about the lint
no step source is recorded, so the AST surface costs nothing
An error-severity lint finding fails the run
✓ passed 33ms
Given
a suite whose given step has an empty body
from pytest_given import scenario, given, when, then

@scenario("Empty given")
def test_empty_given():
    with given("a value"):
        pass
    with when("computing"):
        x = 2
    with then("it is two"):
        assert x == 2
When
the suite runs with the lint enabled
Then
the run exits failed, naming the lint rule and the step
A narration lint run that finds nothing says so
✓ passed 32ms
Given
a suite whose steps are all sound
from pytest_given import scenario, given, when, then

@scenario("Clean")
def test_clean():
    with given("a value"):
        x = 1
    with when("it is doubled"):
        x = x * 2
    with then("it is two"):
        assert x == 2
When
the suite runs with the lint enabled
Then
the run passes
the summary says the lint ran and found nothing
every step source is recorded for the AST rules
A lint rule downgraded to warn reports without failing the run
✓ passed 31ms
Given
a suite whose given step has an empty body
from pytest_given import scenario, given, when, then

@scenario("Empty given")
def test_empty_given():
    with given("a value"):
        pass
    with when("computing"):
        x = 2
    with then("it is two"):
        assert x == 2
When
the suite runs with that lint rule set to warn
Then
the run still passes
the lint finding is printed anyway
An ignore entry suppresses the lint findings it matches, and one that matches nothing fails the run
✓ passed 203ms
Given
a suite with {suite}
test file
When
the suite runs with the lint and given_lint_ignore={entry}
Then
the lint outcome is {outcome}, and only a suppressed run passes
an unsuppressed lint finding is reported as an error
an entry that suppressed nothing is reported as stale
suite test file entry outcome
a flawed step '' reported
test file
from pytest_given import scenario, given, when, then

@scenario("Empty given")
def test_empty_given():
    with given("a value"):
        pass
    with when("computing"):
        x = 2
    with then("it is two"):
        assert x == 2
a flawed step '*::test_empty_given' suppressed
test file
from pytest_given import scenario, given, when, then

@scenario("Empty given")
def test_empty_given():
    with given("a value"):
        pass
    with when("computing"):
        x = 2
    with then("it is two"):
        assert x == 2
a flawed step 'empty-step: *::test_empty_given' suppressed
test file
from pytest_given import scenario, given, when, then

@scenario("Empty given")
def test_empty_given():
    with given("a value"):
        pass
    with when("computing"):
        x = 2
    with then("it is two"):
        assert x == 2
a clean step '*::test_nothing' stale
test file
from pytest_given import scenario, given, when, then

@scenario("Clean")
def test_clean():
    with given("a value"):
        x = 1
    with when("it is doubled"):
        x = x * 2
    with then("it is two"):
        assert x == 2
Either narration lint flag overrides the ini for one run
✓ passed 164ms
Given
a suite with one flawed step
from pytest_given import scenario, given, when, then

@scenario("Empty given")
def test_empty_given():
    with given("a value"):
        pass
    with when("computing"):
        x = 2
    with then("it is two"):
        assert x == 2
When
the suite runs with the lint enabled by ini but off by flag
Then
the lint does not run
When
the suite runs with the lint disabled by ini but on by flag
Then
the lint runs and its error finding fails the run
An error lint finding leaves a more specific exit code alone
✓ passed 46ms
Given
a suite whose lint would fail, under a stale ignore entry
from pytest_given import scenario, given, when, then

@scenario("Empty given")
def test_empty_given():
    with given("a value"):
        pass
    with when("computing"):
        x = 2
    with then("it is two"):
        assert x == 2
When
the suite runs deselected, so nothing is collected
Then
the lint still reports the stale entry as an error lint finding
the run keeps NO_TESTS_COLLECTED rather than reporting a test failure
A failure inside the lint keeps the report it was handed
✓ passed 149ms
Given
a clean suite and a lint pass that raises
When
the suite runs with an HTML report
Then
the failure is summarized as the lint's, rather than raised as a traceback or titled as a report that was not written
the report that was already written is still there
skills install removes what no bundled file accounts for, the directories it empties included
✓ passed 20ms
Given
installed skills holding a stale file two directories deep
When
skills install runs again
Then
it succeeds
the stale file and both directories it emptied are gone
a bundled file beside them stays in place
A scenario records under its node ID
✓ passed 0ms
Given
a fresh collector
When
a scenario starts under its node ID and finishes
Then
it carries its node ID, scenario title, status and tag
The collector records each step with its phase
✓ passed 0ms
Given
an active scenario in a fresh collector
When
a given and a when step are pushed
Then
each step carries its phase
Steps pushed during fixture setup record into the fixture recording
✓ passed 0ms
Given
a fixture recording under setup
When
a step is pushed inside the fixture body
Then
it is recorded as a child of the recording root
An attachment lands on the step being recorded
✓ passed 0ms
Given
a fixture recording under setup
When
an attachment is attached inside the fixture body
Then
the attachment lands on the recording root
Fixture-body steps do not leak into the active scenario
✓ passed 0ms
Given
an active scenario with a fixture recording
When
a step is pushed inside the fixture body
Then
the step lives only in the recording, not the scenario
An attachment outside every step is refused
✓ passed 0ms
Given
an active scenario with no step open
When
an attachment is made from the test body
Then
it is refused rather than dropped
Each graft gets its own copy of the fixture recording
✓ passed 0ms
Given
a fixture recording with a nested child step
When
a graft copies it into the active scenario
Then
the scenario gains a deep copy of the recorded steps
A teardown failure keeps the error the scenario already carries
✓ passed 0ms
Given
a scenario that already failed in its body
When
its fixture then also fails in teardown
Then
the body failure is what the report shows
A collector reports which node IDs it recorded
✓ passed 0ms
Given
a collector that recorded one scenario
When
the recorded and an unrecorded node ID are both asked about
Then
only the recorded node ID is claimed
A given annotation with no recording behind it is grafted as a childless given step
✓ passed 0ms
Given
an active scenario is being recorded
When
a given annotation is grafted on its own
Then
the step is a given with no children
Grafting with a given annotation replaces the root label but keeps children
✓ passed 0ms
Given
a fixture recording whose root has a label and a child
When
the graft carries a given annotation
Then
the grafted root shows the annotation's text and keeps its children
Grafting with no active scenario is refused
✓ passed 0ms
Given
a collector with no active scenario
When
a leaf graft runs
Then
the invariant is asserted rather than silently dropping the step
A file glossary looks terms up case-insensitively
✓ passed 7ms
Given
a file glossary loaded from a Markdown file
# Glossary

| Term | Meaning |
|------|---------|
| Guest  | A person booking. |
| Room   | A bookable room. |
| search | Look up options. |
When
the same term is looked up in three different cases
Then
every lookup resolves to one handle type and the same id
Repeated lookups return the same handle
✓ passed 1ms
Given
a file glossary loaded from a Markdown file
# Glossary

| Term | Meaning |
|------|---------|
| Guest  | A person booking. |
| Room   | A bookable room. |
| search | Look up options. |
When
the same term is looked up twice
Then
both lookups return the one memoized handle
File-loaded terms start kindless
✓ passed 1ms
Given
a Markdown glossary file with no kind column
# Glossary

| Term | Meaning |
|------|---------|
| Guest  | A person booking. |
| Room   | A bookable room. |
| search | Look up options. |
When
a file glossary loads it
Then
each term is kindless until kind inference runs
A misspelt name looked up in a file glossary gets a spelling hint
✓ passed 1ms
Given
a file glossary loaded from a Markdown file
# Glossary

| Term | Meaning |
|------|---------|
| Guest  | A person booking. |
| Room   | A bookable room. |
| search | Look up options. |
When
a misspelt term is looked up
Then
a PytestGivenError is raised with a spelling hint
Handles are usable inline in a sentence
✓ passed 2ms
Given
a file glossary loaded from a Markdown file
# Glossary

| Term | Meaning |
|------|---------|
| Guest  | A person booking. |
| Room   | A bookable room. |
| search | Look up options. |
When
its handles build a sentence
Then
each slot becomes a term ref
Calling a handle overrides its display
✓ passed 1ms
Given
a file glossary loaded from a Markdown file
# Glossary

| Term | Meaning |
|------|---------|
| Guest  | A person booking. |
| Room   | A bookable room. |
| search | Look up options. |
When
a handle is called to name an instance
Then
the term ref carries the overridden display
An explicit kind column sets term kinds
✓ passed 2ms
Given
a Markdown glossary with an explicit Kind column
| Term | Meaning | Kind |
|---|---|---|
| Guest | x | Actor |
| Room | y | Work Object |
| book | z | Activity |
When
the file glossary reads the Kind column
Then
kinds come straight from the file, not kind inference
A kind column can be selected by integer index
✓ passed 2ms
Given
a Markdown glossary with the kind in the third column
| Term | Meaning | Kind |
|---|---|---|
| Guest | x | Actor |
| Room | y | Work Object |
When
the file glossary selects the kind column by index
Then
the kinds are read from that column
A work_object kind cell maps to the work object kind
✓ passed 2ms
Given
a glossary whose Kind cell says work_object
| Term | Meaning | Kind |
|---|---|---|
| Room | y | work_object |
When
the file glossary parses the kind
Then
it normalizes to the work object kind
An unrecognized kind value is rejected
✓ passed 2ms
Given
a glossary whose Kind cell holds an unknown value
| Term | Meaning | Kind |
|---|---|---|
| Guest | x | Wizard |
When
the file glossary loads the file
Then
a PytestGivenError names the unrecognized kind
A missing glossary file is refused as not found
✓ passed 0ms
Given
a path to a file that does not exist
When
a file glossary is opened on that path
Then
a PytestGivenError reports the file is not found
A term cell with no alphanumeric characters is rejected
✓ passed 2ms
Given
a row whose term cell has no id-able characters
| Term | Meaning |
|---|---|
| @#$ | some definition |
When
the file glossary loads the file
Then
a PytestGivenError is raised with file:line context
A file glossary error about its tables names the file
✓ passed 7ms
Given
a glossary file with {problem}
that file on disk as bad.md
Glossary file
When
a file glossary loads it
Then
a PytestGivenError names the file before the problem: {message}
problem Glossary file message
no table bad.md: found no Markdown pipe table
Glossary file
# no table here
a header but no data rows bad.md: the glossary file's Markdown table has no data rows
Glossary file
| Term | Meaning |
|---|---|
no Term column bad.md: column 'Term'
Glossary file
| Word | Meaning |
|---|---|
| Guest | x |
Duplicate rows for one term collapse only when identical
✓ passed 4ms
Given
two rows for one term, with identical definitions: {identical}
Glossary file
When
the file glossary loads the file
Then
the rows yield {outcome}
a refusal points at the second row as the conflict
identical Glossary file outcome
True one term
Glossary file
| Term | Meaning |
|---|---|
| Guest | First definition. |
| Guest | First definition. |
False refused
Glossary file
| Term | Meaning |
|---|---|
| Guest | First definition. |
| Guest | Second definition. |
A blank definition normalizes to undefined
✓ passed 2ms
Given
a row whose definition cell is blank
| Term | Meaning |
|---|---|
| Guest |   |
When
the file glossary parses it
Then
the term definition is None, i.e. undefined
Calling a file glossary looks up a known term
✓ passed 1ms
Given
a file glossary loaded from a Markdown file
# Glossary

| Term | Meaning |
|------|---------|
| Guest  | A person booking. |
| Room   | A bookable room. |
| search | Look up options. |
When
a known term is looked up by call
Then
a deferred term is returned
A file glossary is a closed vocabulary
✓ passed 2ms
Given
a file glossary loaded from a Markdown file
# Glossary

| Term | Meaning |
|------|---------|
| Guest  | A person booking. |
| Room   | A bookable room. |
| search | Look up options. |
When
an unknown name is called
Then
a PytestGivenError is raised
no new term was created
A term's ID is its name as a URL-safe slug
✓ passed 0ms
Given
the name {text}
When
it is slugified into a term id
Then
the id is {slug}
text slug
'Guest' 'guest'
'Order received' 'order-received'
' Work Object ' 'work-object'
'do_the_thing' 'do-the-thing'
'Buy / sell' 'buy-sell'
'Guest #1' 'guest-1'
'café' 'caf'
'booking system' 'booking-system'
A term name that leaves no slug is refused
✓ passed 0ms
Given
the name {text}
When
it is slugified into a term id
Then
a PytestGivenError reports the derived id is empty
text
'---'
' '
''
'###'
Calling an actor names a distinct instance
✓ passed 0ms
Given
an actor handle for Guest
When
the actor is called with a name
Then
an instance with a distinct display is returned
Calling an activity records an inflection of the same term
✓ passed 0ms
Given
an activity handle for confirm
When
the activity is called with a surface form
Then
an inflection sharing the activity identity is returned
Registering an actor returns a typed handle
✓ passed 0ms
Given
an empty glossary
When
an actor is registered with a definition
Then
a handle carrying the actor kind is returned
Re-registering a term is idempotent only with matching fields
✓ passed 0ms
Given
an actor already registered with a definition
When
the same name is registered again, with the same definition: {same_definition}
Then
the re-registration yields {outcome}
a refusal reports the conflict with the prior registration
same_definition outcome
True one shared term
False refused
The same name cannot be two different kinds
✓ passed 0ms
Given
a name already registered as an actor
When
the same name is registered as an activity
Then
a PytestGivenError reports the conflict with the prior registration
Registering an actor captures its definition site
✓ passed 0ms
Given
a rootdir-aware glossary
When
an actor is registered
Then
the term records a source link to this file
Calling the glossary declares a kindless term
✓ passed 0ms
Given
an empty glossary
When
a term is declared by call, without a kind
Then
the term is registered as kindless
The lowercase handle form lowercases only capitalized words
✓ passed 0ms
Given
a term named {canonical}
When
its lowercase handle form is taken
Then
it reads {lowered}
canonical lowered
'Booking Request' 'booking request'
'LLM Call' 'LLM call'
'Check-In' 'check-in'
'Plan B' 'plan B'
'E-Mail' 'e-mail'
'LLM-Based Search' 'LLM-based search'
'iPhone' 'iPhone'
'McDonald' 'McDonald'
The S-form and lowercase handle forms chain, and every reading stays the same term
✓ passed 0ms
Given
a term named {canonical}
When
the handle forms {forms} are applied in order
Then
it reads {reading} and refers to the same term
canonical forms reading
'Room' 's' 'Rooms'
'Room' 'l.s' 'rooms'
'Room' 's.l' 'rooms'
'Box' 'l.s' 'boxes'
'Category' 'l.s' 'categories'
'API Key' 'l.s' 'API keys'
'API' 's' 'APIs'
'book' 's' 'books'
The S-form and lowercase handle forms also apply to a called form
✓ passed 0ms
Given
a term named "Room"
When
it is called as "Deluxe Suite" and both forms are applied
Then
it reads "deluxe suites" and refers to the same term
Subscript looks up an already-declared term
✓ passed 0ms
Given
a glossary with one declared term
When
the name is looked up by subscript
Then
the returned term is the declared one
Subscripting an unknown name raises with a hint
✓ passed 0ms
Given
a glossary with one declared term
When
a near-miss name is subscripted
Then
a PytestGivenError is raised with a spelling hint
A kindless term takes its kind from the slots it fills
✓ passed 0ms
Given
a kindless term filling the {slots} slots, one story each
When
kind inference runs over the stories
Then
the inferred kind is {kind}
slots kind
actor actor
verb activity
noun object
actor, noun actor
A kindless term filling incompatible slots is refused
✓ passed 0ms
Given
a kindless term filling the {slots} slots, one story each
When
kind inference runs over the stories
Then
a PytestGivenError names the term and the conflict
slots
verb, actor
verb, noun
A declared kind must fit the slot its term fills
✓ passed 0ms
Given
a term declared as {declared}
a story putting it in the {slot} slot
When
kind inference runs over the story
Then
the declared kind is {outcome}
a refusal names the declared kind and the slot
declared slot outcome
actor actor kept
activity actor refused
object actor refused
actor verb refused
activity verb kept
object verb refused
actor noun kept
activity noun refused
object noun kept
A term named only in the second clause of a sentence gets its kind inferred
✓ passed 0ms
Given
a glossary of kindless term entries
a sentence whose second clause starts at another actor
When
kind inference runs over its story
Then
the first term of the second clause is an actor
A declared kind's conflict names only the stories that put its term in the wrong slot
✓ passed 0ms
Given
an actor term that also appears in a verb slot
When
kind inference runs over both stories
Then
a PytestGivenError reports the declared actor in a verb slot
only the offending story is named in the message
An inferred kind's conflict names only the stories whose slots disagree
✓ passed 0ms
Given
a kindless term used in verb, actor and noun slots
When
kind inference runs over all three stories
Then
a PytestGivenError reports the verb-vs-actor conflict
only the verb and actor stories are named, not the noun one
Slot positions alternate verb/noun after the actor
✓ passed 0ms
Given
the five positions of a short clause
When
the slot rule is applied to each position
Then
position 0 is the actor slot, then verb and noun alternate
A pipe table parses into term and definition rows
✓ passed 0ms
Given
a Markdown document with one pipe table
# Glossary

| Term | Meaning |
|------|---------|
| Guest | A person booking. |
| Room  | A bookable room. |
When
the parser reads it into rows for a file glossary
Then
each row carries a term, definition and source line
Multiple tables in one file are merged
✓ passed 0ms
Given
a document containing two separate pipe tables
# Glossary

| Term | Meaning |
|------|---------|
| Guest | A person booking. |
| Room  | A bookable room. |

## More

| Term | Meaning |
|---|---|
| Search | Look up. |
When
the parser reads the whole document
Then
every table contributes its term rows
Columns can be selected by header name
✓ passed 0ms
Given
a table with custom, differently-cased header names
| Word | Note | Role |
|---|---|---|
| Guest | x | Actor |
When
the parser selects columns by header name
Then
the named columns are matched case-insensitively
Escaped pipes are preserved in cells
✓ passed 0ms
Given
cells containing escaped pipe characters (\|)
| Term | Meaning |
|---|---|
| A\|B | pipe\|here |
When
the parser splits the row
Then
the escaped pipe survives as a literal pipe
A file glossary table the parser cannot read is refused, saying what is wrong
✓ passed 0ms
Given
a Markdown document with {document}
Markdown document
the columns selected as {columns}, the rest left at their defaults
When
the parser reads the document
Then
a PytestGivenError says {message}
document Markdown document columns message
no pipe table {} found no Markdown pipe table
Markdown document
# Just a heading

No tables here.
one pipe table {'term_column': 'Nope'} column 'Nope' not found
Markdown document
# Glossary

| Term | Meaning |
|------|---------|
| Guest | A person booking. |
| Room  | A bookable room. |
one pipe table {'definition_column': 5} column index 5 is out of range
Markdown document
# Glossary

| Term | Meaning |
|------|---------|
| Guest | A person booking. |
| Room  | A bookable room. |
A file glossary reads the tables a GFM renderer shows, and no others
✓ passed 0ms
Given
a Markdown document with {document}
Markdown document
When
the parser reads the document
Then
it reads the term and definition rows {rows}
document Markdown document rows
a table in a blockquote [('Quoted', 'yes')]
Markdown document
> | Term | Meaning |
> |---|---|
> | Quoted | yes |
a table in an indented code block [('Real', 'yes')]
Markdown document
    | Term | Meaning |
    |---|---|
    | Code | no |

| Term | Meaning |
|---|---|
| Real | yes |
a separator row narrower than its header [('Real', 'yes')]
Markdown document
| Term | Meaning |
|---|
| Odd | no |

| Term | Meaning |
|---|---|
| Real | yes |
a data row narrower than its header [('Short', '')]
Markdown document
| Term | Meaning |
|---|---|
| Short |
a table in a fenced code block [('Real', 'yes')]
Markdown document
```
| Term | Meaning |
|---|---|
| Fake | nope |
```

| Term | Meaning |
|---|---|
| Real | yes |
a pipe line with no separator row [('Real', 'yes')]
Markdown document
This line has a | in it but no separator follows.
Next line is not a separator.

| Term | Meaning |
|---|---|
| Real | yes |
A term or kind cell is read as its plain text, with emphasis unwrapped
✓ passed 0ms
Given
a {column} cell written as {cell}
When
the parser reads the row
Then
the {column} is {plain}
column cell plain
term **Scenario** Scenario
term *Step* Step
term `given` given
term work_object work_object
term `a*b*c` a*b*c
term __Scenario__ __Scenario__
kind **Actor** Actor
kind `activity` activity
Definition markdown is left intact
✓ passed 0ms
Given
a definition cell rich with inline code
| Term | Meaning |
|---|---|
| Scenario | A test decorated with `@scenario(...)`. |
When
the parser reads the row
Then
the definition keeps its markup for the tooltip
A step pairs its narration with a phase
✓ passed 0ms
When
a given step descriptor is created
Then
it carries the given phase and its narration
A step opened outside a scenario warns rather than raising
✓ passed 0ms
Given
a collector recording inside an undecorated test
When
a given step is opened against it
Then
a PytestGivenWarning is raised, not an error
it names the missing @scenario, so a suite can filter it
when_then records the action and its outcome as siblings
✓ passed 0ms
Given
an active scenario in a local collector
When
a when_then block exits cleanly
Then
a when and a sibling then step are recorded
when_then pairs with an inner pytest.raises
✓ passed 0ms
Given
an active scenario in a local collector
When
the when_then body raises and an inner pytest.raises swallows it
Then
both sibling steps are still recorded
when_then omits the then when the body raises uncaught
✓ passed 0ms
Given
an active scenario in a local collector
When
the when_then body raises with nothing catching inside
Then
only the when step is recorded — the outcome never held
Inside a when_then body only a when may open, as a child of the action
✓ passed 0ms
Given
an active scenario in a local collector
When
a {phase_name} step opens inside the when_then body
Then
the inner step is {outcome}
a refusal reports the cross-phase nesting
the step stack is left balanced
phase_name outcome
when nested
given refused
then refused
@scenario marks the test function without wrapping it
✓ passed 0ms
Given
a test function taking one fixture
When
the function is decorated
Then
the very same function comes back, keeping its signature
it is recognized as a scenario, with its title; a plain function is not
An attachment label must be plain text
✓ passed 0ms
Given
a non-str attachment label of kind {label_kind}
When
it is attached
Then
a PytestGivenError says attachment labels are plain text
label_kind
deferred-template
t-string
not-a-string
A Template narration is refused in a test body
✓ passed 0ms
Given
an active scenario in a local collector
When
a {phase_name} step opens on a Template
Then
a PytestGivenError says a template is not supported in a test body
phase_name
given
when
then
A pin takes a sentence handle from its story, never a bare number or name
✓ passed 0ms
Given
the bare sentence reference {written}
When
a step is declared with it as its pin
Then
a PytestGivenError shows the handle form
written
2
cancel
[1, 2]
An actor handle in a clause becomes a term ref
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
When
a clause is built from three glossary handles
Then
the actor slot becomes a term ref
An inflected activity keeps its term identity but shows the inflection
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
an activity handle called with an inflection
When
it takes the verb slot of a clause
Then
the term ref shows the inflection over the same activity
A bare string in a clause becomes a connective word
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
When
a clause is built with a bare word between term nodes
Then
the bare word becomes a clause part word, not a term ref
A clause needs at least an actor, an activity and a node
✓ passed 0ms
Given
a Guest actor
a search activity
When
a clause of only two parts is built
Then
a PytestGivenError rejects it as too short, counting the parts
A clause position takes only the kinds its slot accepts
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
a term declared as {kind}
When
a clause is built with it at position {position}
Then
the term is {outcome}
a refusal names the position and the declared kind
kind position outcome
actor 0 accepted
actor 1 refused
actor 2 accepted
object 0 refused
object 1 refused
object 2 accepted
activity 0 refused
activity 1 accepted
activity 2 refused
None 0 accepted
None 1 accepted
None 2 accepted
A bare string may fill any slot of a clause, as a word
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
the bare string "plain"
When
a clause is built with it at position {position}
Then
it becomes a clause part word there
the other parts stay term refs
position
0
1
2
A clause may be fully bare words
✓ passed 0ms
Given
three plain words with no glossary handles
When
a clause is built from them
Then
every part is a clause part word
A connective word may join a second actor onto a clause
✓ passed 0ms
Given
an actor, an activity, a work object and a second actor
When
they form a five-part clause joined by a connective
Then
even positions are term-ref nodes and the connective stays a word
A clause may not end on a dangling edge
✓ passed 0ms
Given
an actor, activity and work object plus a connective
When
a clause ending on a connective edge is built
Then
a PytestGivenError names the trailing arrow with no target
A sentence built from loose parts holds them as one clause
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
When
a sentence is built from handles directly
Then
it wraps a single clause
A sentence may hold several clauses
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
two clauses
When
they are combined into one sentence
Then
the sentence carries both clauses
Mixing loose parts and prebuilt clauses is rejected
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
a prebuilt clause
When
it is combined with loose handles in one sentence
Then
a PytestGivenError rejects the mix
A story auto-numbers its sentences from one
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
When
a story is built from two sentence rows
Then
the sentences are numbered 1 and 2
A story derives its id from its title
✓ passed 0ms
Given
a human-readable story title
When
a story is built from it
Then
its id is the slugified title
A story may span only one glossary
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
two sentences that reach two different glossaries
When
a story is built spanning both glossaries
Then
a PytestGivenError says a story spans multiple glossaries
A sentence handle is looked up by name or by number
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
a story whose second sentence is named
When
the sentence is looked up by its name and by its number
Then
both handles name sentence 2 of that story
Iterating a story yields its sentence handles
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
a story of two sentences
When
the story is iterated
Then
it yields each sentence handle in order
Looking up a missing sentence lists the ones the story has
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
a story with an unnamed and a named sentence
When
an unknown name is looked up
Then
a PytestGivenError lists the story's sentences
Two sentences of one story cannot share a name
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
two sentences both named "cancel"
When
a story is built from them
Then
a PytestGivenError names the duplicate and both numbers
A sentence name must be non-empty and unpadded
✓ passed 0ms
Given
a Guest actor
a search activity
a Room work object
the sentence name {name}
When
a sentence is built with that name
Then
a PytestGivenError says what a name must be
name
''
' cancel'
'cancel '
Two stories with the same id collide
✓ passed 0ms
Given
a story already declared under an id
When
a second story is declared with the same slug
Then
a PytestGivenError reports the id was already declared
A clause may chain a second verb-object pair
✓ passed 0ms
Given
an actor, two activity and two work object handles
When
they form a five-node clause (actor verb object verb object)
Then
every slot is a term ref, with no bare words
A file glossary's declared kind is checked when a clause is built
✓ passed 2ms
Given
a file glossary declaring Room a work object
When
Room is placed in the verb slot
Then
a PytestGivenError names the term and its declared kind
A slot error names the term, not its repr
✓ passed 0ms
Given
a Guest actor
a Room work object
a search activity
When
a work object is placed in the verb slot
Then
the message names the term without dumping the glossary
the message is short and free of dataclass reprs
A non-handle clause part names its type
✓ passed 0ms
Given
a Guest actor
a Room work object
When
an int is passed where an activity handle belongs
Then
a PytestGivenError names the offending type and the clause
A Template parses a bare placeholder
✓ passed 0ms
Given
a deferred Template with one placeholder
When
the template is parsed
Then
it splits into literal and placeholder narration parts
A Template substitutes parametrize values
✓ passed 0ms
Given
a Template referencing a parametrize column
When
a parametrize value is substituted in
Then
the placeholder is filled with that value
A Template accepts bare identifiers only
✓ passed 0ms
Given
the placeholder {text}
When
a Template is built from it
Then
a PytestGivenError says bare identifiers only
case ID text
attribute count={obj.attr}
indexing {d[key]}
expression {x + 1}
A t-string interpolation records its rendered value and its expression
✓ passed 0ms
Given
a t-string step with one interpolated value
When
the t-string is parsed at runtime
Then
the interpolation becomes a narration value part
A t-string can interpolate an arbitrary expression
✓ passed 0ms
Given
a t-string step interpolating a computed expression
When
the t-string is parsed
Then
it renders the result, its value part recording the full expression
A handle in a t-string becomes a term ref showing what it was called with
✓ passed 0ms
Given
the {name} handle from the glossary, called with {called_with}
When
the handle is interpolated into a t-string step
Then
the step carries one term ref, to {term_id}
it shows {display}
name called_with term_id display
Guest None guest Guest
Guest Alice guest Alice
Room None room Room
Room Deluxe Suite room Deluxe Suite
search None search search
search searches for search searches for
A term ref may not carry a format spec
✓ passed 0ms
Given
an actor handle interpolated with a format spec
When
the t-string is parsed
Then
a PytestGivenError says a term ref takes no format spec
A file glossary handle works in a t-string step
✓ passed 0ms
Given
a deferred term from a file glossary
When
it is interpolated into a t-string step
Then
the step carries a single term ref
A span holding a value, a placeholder or a term ref is refused
✓ passed 0ms
Given
a code span around a t-string value, bold around a term ref and italics around a Template placeholder
When
the narration of each is built
Then
each is refused, naming the part its span holds
each says the span would not render
citations update rewrites a stale citation to its target's glyph, text and summary
✓ passed 8ms
Given
a report where the tag checkout has a passed and an xfailed scenario
a document citing the tag under another name, as all passed
✅ [Checkout](https://example.org/report.html#tag=checkout) (1 ✅)
When
the document is updated
Then
its glyph, text and summary read what the report says
🔵 [checkout](https://example.org/report.html#tag=checkout) (1 ✅ · 1 🔵)
no finding remains
citations update refuses a document that changed while it ran
✓ passed 4ms
Given
a stale citation to rewrite
❓ [Pay by card](https://example.org/report.html#scenario=t.py::test_pay)
When
another writer saves the document while the update analyzes it
Then
the update refuses, saying the document changed
the other writer's save is what is on disk
A plain report link claims only that its target exists
✓ passed 2ms
Given
a report whose one scenario fails
a document linking it, and a deleted test, in its own words
See [how paying works](https://example.org/report.html#scenario=t.py::test_pay) and [refunds](https://example.org/report.html#scenario=t.py::test_refund).
When
the document is updated
Then
only the link to the deleted test is a finding
the document is left as written
A citation whose target left the report is marked ❓ and recovers once it is back
✓ passed 7ms
Given
a citation of a passing scenario
✅ [Pay by card](https://example.org/report.html#scenario=t.py::test_pay)
When
it is updated against a report that lacks the scenario
Then
it is marked ❓, keeping its target and text
❓ [Pay by card](https://example.org/report.html#scenario=t.py::test_pay)
it stays a finding
When
it is updated once the report holds the scenario again
Then
it reads as current again
A citation of any case cites the grouped scenario holding it
✓ passed 3ms
Given
a report where the cases [a] and [c] of test_pour group into one scenario
a document citing the case [c]
✅ [Pour](https://example.org/report.html#scenario=t.py::test_pour%5Bc%5D)
When
the document is updated
Then
the citation names its scenario by the node ID of test_pour
✅ [Pour](https://example.org/report.html#scenario=t.py::test_pour)
no finding remains
A citation keeps the emphasis its scenario title renders with
✓ passed 6ms
Given
a report whose scenario title sets a word in bold
a document with a placeholder citation of it
? [](https://example.org/report.html#scenario=t.py::test_book)
When
the document is updated
Then
its link text sets the word in bold too
✅ [Books a **suite**](https://example.org/report.html#scenario=t.py::test_book)
citations update repoints the citation of a renamed test by its unchanged scenario title
✓ passed 4ms
Given
a report where test_pay was renamed test_pay_by_card, still titled "Pay by card"
a document whose citation still names test_pay
✅ [Pay by card](https://example.org/report.html#scenario=t.py::test_pay)
When
the document is checked
Then
the citation is a citation finding update fixes, naming test_pay_by_card
When
the document is updated
Then
the citation names test_pay_by_card
✅ [Pay by card](https://example.org/report.html#scenario=t.py::test_pay_by_card)
no finding remains
A relative report link resolves from its document to where --report-path places the report
✓ passed 3ms
Given
a report that stores no URL, placed at examples/r.html
a stale citation in guide/doc.md linking ../examples/r.html
✓ [Pay by card](../examples/r.html#scenario=t.py::test_pay)
When
the document is updated with that --report-path
Then
the citation is read as one and its glyph rewritten
✅ [Pay by card](../examples/r.html#scenario=t.py::test_pay)
--covering keeps each report link whose target counts the scenario, and each it cannot rule out
✓ passed 28ms
Given
a report where test_pay is tagged checkout/card and in a story, test_refund tagged checkout/refund
a document holding the report link {link}
When
its links are checked, covering test_pay
Then
the report link is kept: {kept}
link kept
✅ [Pay by card](https://example.org/report.html#scenario=t.py::test_pay) True
[paying](https://example.org/report.html#scenario=t.py::test_pay) True
✅ [Refund](https://example.org/report.html#scenario=t.py::test_refund) False
✅ [checkout/card](https://example.org/report.html#tag=checkout/card) (1 ✅) True
✅ [checkout](https://example.org/report.html#tag=checkout) (2 ✅) True
✅ [checkout/refund](https://example.org/report.html#tag=checkout/refund) (1 ✅) False
✅ [s](https://example.org/report.html#view=stories&story=s) (1 ✅) True
✅ [Gone](https://example.org/report.html#scenario=t.py::test_gone) True
✅ [search](https://example.org/report.html#q=pay) True
citations update writes a narrated citation's body from the report
✓ passed 4ms
Given
a report whose scenario has two steps
a document holding a narrated citation of it, copied with an empty body
Paying:

<details markdown="1">
<summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>

</details>
When
the document is updated
Then
its body holds the scenario's narration between blank lines
Paying:

<details markdown="1">
<summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>

- **given** a card
- **then** it is paid

</details>
no finding remains
citations check reports a narrated citation whose body differs from the report
✓ passed 2ms
Given
a report whose scenario ends in "it is paid"
a document whose narrated citation of it still ends in "it is charged"
<details markdown="1">
<summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>

- **given** a card
- **then** it is charged

</details>
When
the document is checked
Then
one stale narration is the only citation finding
it names the first line that differs, written and expected
A narrated citation of a tag or story is a citation finding update leaves
✓ passed 4ms
Given
a report whose scenario is tagged checkout and covers the story checkout
a document with a narrated citation of the {target}, its glyph and body stale
document
When
the document is updated
Then
a stray narration is the only citation finding, one update cannot fix
the document is left as written
target document
tag
document
<details markdown="1">
<summary>❌ <a href="https://example.org/report.html#tag=checkout">checkout</a></summary>

The checkout.

</details>
story
document
<details markdown="1">
<summary>❌ <a href="https://example.org/report.html#view=stories&story=checkout">checkout</a></summary>

The checkout.

</details>
A <details> block citing the report in any other shape is a mistyped citation finding, never skipped
✓ passed 9ms
Given
a document whose <details> block cites the report with {shape}
document
When
the document is updated
Then
a mistyped citation finding, saying {reason}, is the only one
the document is left as written
shape document reason
an anchor with a class its <a> takes attributes besides href
document
<details markdown="1">
<summary>✅ <a class="x" href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>

</details>
a single-quoted href its href is not in double quotes
document
<details markdown="1">
<summary>✅ <a href='https://example.org/report.html#scenario=t.py::test_pay'>Pay by card</a></summary>

</details>
no closing tag no </details> closes it
document
<details markdown="1">
<summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>

After.
no blank line above it, below another one a blank line must separate it from the HTML above it
document
<details markdown="1">
<summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>

- **given** a card
- **then** it is paid

</details>
<details markdown="1">
<summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>

- **given** a card
- **then** it is paid

</details>
A narrated citation copied from the report is current once citations update fills its body
✓ passed 6ms
Given
a report whose scenario title holds a code span and an ampersand
the narrated citation the copy menu copies, pasted into a document
<details markdown="1">
<summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay <code>a&amp;b</code> &amp; more</a></summary>

</details>
When
the document is updated
Then
its body holds the scenario's narration
<details markdown="1">
<summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay <code>a&amp;b</code> &amp; more</a></summary>

- **given** a card
- **then** it is paid

</details>
When
the updated document is checked
Then
no finding remains
A failing narrated citation has its body rewritten and stays a citation finding
✓ passed 3ms
Given
a report whose scenario fails
a document holding a narrated citation of it, copied with an empty body
<details markdown="1">
<summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>

</details>
When
the document is updated
Then
its glyph reads ❌ and its body holds the narration
<details markdown="1">
<summary>❌ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>

- **given** a card
- **then** it is paid

</details>
the failure is the only finding that remains
citations update adds markdown="1" to a narrated citation's opening tag, keeping its other attributes
✓ passed 27ms
Given
a current narrated citation whose opening tag is {opening}
When
the document is checked
Then
a stale opening tag is the only citation finding, naming its fix
When
the document is updated
Then
the opening tag reads {expected}
opening expected
<details open> <details markdown="1" open>
<details open markdown="0"> <details open markdown="1">
<details markdown='block'> <details markdown="1">
<details markdown> <details markdown="1">
<details title="see markdown here"> <details markdown="1" title="see markdown here">
A narrated citation in a list item or blockquote has its body written under that prefix
✓ passed 9ms
Given
a narrated citation copied with an empty body into a {container}
document
When
the document is updated
Then
each body line carries the container's prefix
updated document
a check of the updated document finds nothing
container document updated document
list item
document
- Paying:

  <details markdown="1">
  <summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>

  </details>
updated document
- Paying:

  <details markdown="1">
  <summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>

  - **given** a card
  - **then** it is paid

  </details>
blockquote
document
> <details markdown="1">
> <summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>
>
> </details>
updated document
> <details markdown="1">
> <summary>✅ <a href="https://example.org/report.html#scenario=t.py::test_pay">Pay by card</a></summary>
>
> - **given** a card
> - **then** it is paid
>
> </details>
Narration lint flags a step whose body does nothing
✓ passed 1ms
Given
a given step whose body is only pass
def test_a():
    with given('a value'):
        pass
When
the AST lint rules parse that source
Then
an empty-step lint finding points at the step line
its severity is error
Narration lint flags a then step that checks nothing
✓ passed 5ms
Given
a then step whose body only calls
def test_a():
    with then('it is one'):
        x = compute()
        handlers[0](x)
When
the AST lint rules parse that source
Then
a then-without-check lint finding reports the unchecked then
Narration lint flags a then step that checks only on some runs
✓ passed 8ms
Given
a then step whose only assert sits under an if
def test_a():
    with then('a cached entry points at its record'):
        if 'index' in entry:
            assert records[entry['index']] == expected
When
the AST lint rules parse that source
Then
a conditional-check lint finding reports the guarded then
its severity is warn
Narration lint flags an assert outside a then step
✓ passed 16ms
Given
a {phase} step whose body asserts
step body
When
the AST lint rules parse that source
Then
the warn lint findings say {messages}
phase step body messages
given ["assert inside given 'a stocked machine'"]
step body
def test_a():
    with given('a stocked machine'):
        machine = stock()
        assert machine['coffees'] > 0
when ["assert inside when 'a stocked machine'"]
step body
def test_a():
    with when('a stocked machine'):
        machine = stock()
        assert machine['coffees'] > 0
then []
step body
def test_a():
    with then('a stocked machine'):
        machine = stock()
        assert machine['coffees'] > 0
Narration lint flags a then step that folds in the action
✓ passed 1ms
Given
a scenario with no when, acting inside its then
def test_a():
    with given('a machine'):
        machine = stock()
    with then('it brews'):
        assert brew(machine) == 'coffee'
When
the AST lint rules parse that source
Then
a warn lint finding points at the then and says no when acts
Narration lint flags a narration interpolating a name the body never uses
✓ passed 8ms
Given
a given step whose body never loads the name
def test_a():
    with given(t'a {size} ml cup'):
        cup = make_cup()
When
the AST lint rules parse that source
Then
a warn lint finding names the interpolation the body ignores
Narration lint flags a passed scenario that skips a phase
✓ passed 0ms
Given
a passed scenario narrating only given and then
When
the runtime lint rules run
Then
one missing-phase lint finding names the absent when and the scenario source
its severity is the catalog default, warn
Narration lint flags a tag that duplicates a term
✓ passed 0ms
Given
a glossary defining one term
two scenarios carrying that word as a tag
When
the runtime lint rules run
Then
a single warn lint finding names the tag and the term it shadows, counting the scenarios and naming one
Narration lint flags a term referenced by no scenario title, step or story
✓ passed 0ms
Given
a glossary holding one unreferenced term
When
the runtime lint rules run over no scenarios and no stories
Then
the lint finding names the unreferenced term
its severity is off — the rule is opt-in
Narration lint counts a term named only in the second clause of a sentence as referenced
✓ passed 0ms
Given
a story whose one sentence names the term only in its second clause
When
the runtime lint rules run over that story
Then
dead-term flags none of its terms
A sentence references its terms, whatever surface form they take
✓ passed 0ms
Given
a sentence written with an instance and an inflection
When
coverage collects the sentence references
Then
they are the term ids alone; words contribute nothing
A multi-clause sentence unions references across its clauses
✓ passed 0ms
Given
a sentence with two clauses
When
coverage collects the sentence references
Then
the terms of both clauses are present
A sentence whose clauses start at different actors builds and is covered
✓ passed 0ms
Given
a sentence of two clauses: a guest signs the register, and a clerk signs the register
a step naming both actors, the activity and the register
When
coverage is computed against the story
Then
the sentence is covered
A step references its terms, whatever surface form they take
✓ passed 0ms
Given
a step naming an instance and an inflection
When
coverage collects the step references
Then
they are the term ids alone
An instance and its bare term cover each other
✓ passed 0ms
Given
a sentence naming a bare actor
the same sentence naming an instance of that actor
a step naming the instance, and one naming the bare actor
When
coverage is computed for each pairing
Then
the instance step covers the bare sentence
the bare step covers the instance sentence
A sentence is covered by one step naming all its terms, never by several steps together
✓ passed 0ms
Given
a story whose sentence names guest, search and room
a scenario whose steps name {steps_naming}
When
coverage is computed against the story
Then
the sentence is covered: {covered}
steps_naming covered
[['guest', 'search', 'room']] True
[['guest', 'search'], ['room']] False
[['guest'], ['guest', 'search', 'room']] True
Promoting a bare word to an activity ref drops coverage from a step that matched
✓ passed 0ms
Given
a step naming two term refs
the same sentence with that middle slot a bare word, then an activity ref
When
coverage is computed against each story
Then
the two-ref sentence is covered
the widened sentence is no longer covered
A pin on a step or its scenario replaces narration matching
✓ passed 0ms
Given
a scenario with pins={scenario_pins}
a step matching sentence 1, with pins={step_pins}
When
coverage is computed against the story
Then
the scenario covers the sentences {covered}
case ID scenario_pins step_pins covered
nothing-pinned None None [1]
step-pinned None [2] [2]
scenario-pinned [] None []
both-pinned [] [2] [2]
scenario-pins-elsewhere [2] None [2]
scenario-and-step-pinned [1] [2] [1, 2]
A sentence is coverage-eligible only with two distinct terms
✓ passed 0ms
Given
a sentence referencing the terms {term_ids}
When
its coverage eligibility is checked
Then
it is eligible: {eligible}
term_ids eligible
['guest', 'room'] True
['guest', 'guest'] False
['guest'] False
[] False
A nested step covers a sentence like a top-level one
✓ passed 0ms
Given
a story with one canonical sentence
the covering term refs in a nested child step
When
coverage is computed against the story
Then
the nested step still counts and the sentence is covered
The glossary view aggregates instances and activity forms
✓ passed 0ms
Given
a report whose story and scenario reference instances of an actor and a work object, and an inflection
{
  "metadata": {
    "project": "p",
    "timestamp": "t",
    "pytest_version": "8",
    "plugin_version": "0",
    "commit_sha": null,
    "title": null,
    "report_url": null
  },
  "scenarios": [
    {
      "id": "t",
      "narration": {
        "text": "s",
        "parts": []
      },
      "module": "m",
      "tags": [],
      "status": "passed",
      "duration_ms": 0,
      "steps": [
        {
          "phase": "when",
          "narration": {
            "text": "x",
            "parts": [
              {
                "term_id": "guest",
                "display": "Alice",
                "expression": ""
              },
              {
                "term_id": "search",
                "display": "searches",
                "expression": ""
              },
              {
                "term_id": "room",
                "display": "Deluxe Suite",
                "expression": ""
              }
            ]
          },
          "children": [],
          "attachments": [],
          "pins": null,
          "fixture_name": null
        }
      ],
      "parameters": null,
      "error": null,
      "skip_reason": null,
      "xfail_reason": null,
      "source": null,
      "story_ids": [
        "book"
      ],
      "pins": null
    }
  ],
  "glossary": {
    "terms": [
      {
        "id": "guest",
        "kind": "actor",
        "canonical": "Guest",
        "definition": null,
        "source": null
      },
      {
        "id": "room",
        "kind": "object",
        "canonical": "Room",
        "definition": null,
        "source": null
      },
      {
        "id": "search",
        "kind": "activity",
        "canonical": "search",
        "definition": null,
        "source": null
      }
    ]
  },
  "stories": [
    {
      "id": "book",
      "title": "Book",
      "sentences": [
        {
          "id": 1,
          "clauses": [
            {
              "parts": [
                {
                  "term_id": "guest",
                  "display": "Alice"
                },
                {
                  "term_id": "search",
                  "display": "searches for"
                },
                {
                  "term_id": "room",
                  "display": "Deluxe Suite"
                }
              ]
            }
          ],
          "name": null
        }
      ],
      "source": null
    }
  ]
}
When
the glossary aggregations are built
Then
the actor and the work object collect their instances
the activity collects its inflection but not its canonical form
Terms referenced by a sentence record the story
✓ passed 0ms
Given
a story whose sentence references an actor and an activity
When
the glossary aggregations are built
Then
the actor and the activity each list that story
A story referencing a term twice lists it once
✓ passed 0ms
Given
a story whose two sentences repeat the same term and the same inflection
When
the glossary aggregations are built
Then
the story and the inflection appear once each
A canonical reference to an actor or work object is not an instance, whatever its case
✓ passed 0ms
Given
a story sentence referencing an actor and a work object by canonical name, and a step referencing one in lowercase
When
the glossary aggregations are built
Then
neither the actor nor the work object records an instance
An S-form reference is the term itself, not an instance or an inflection
✓ passed 0ms
Given
a story sentence referencing a work object and an activity by their s-forms, each lowercase and capitalized
When
the glossary aggregations are built
Then
the work object records no instance and the activity no inflection
A kindless term records only its story ref
✓ passed 0ms
Given
a kindless term referenced by a story sentence
When
the glossary aggregations are built
Then
the term lists the story but no instance and no inflection
An instance seen in a fixture step records its fixture provenance
✓ passed 0ms
Given
a scenario whose fixture-sourced step names an instance
When
the glossary aggregations are built
Then
the instance carries the fixture name
The term index maps each term to its scenarios once
✓ passed 0ms
Given
a scenario referencing one term in two steps and another in its name
When
the term-scenario index is built
Then
each term maps to the scenario exactly once
Parameter coloring ties each placeholder to its column header
✓ passed 171ms
Given
a report holding a parametrized scenario with a parameter table of the columns euros and expect
When
the renderer renders the HTML page
Then
the grouped step shows its placeholder, keyed to the euros column
each column header carries its own column key
The renderer treats a parameter table column narrated with !r or !a as a repr column
✓ passed 0ms
Given
a step whose placeholder has the conversion {conversion}
When
the renderer picks the repr columns
Then
the column is one of them: {repr_column}
conversion repr_column
'r' True
'a' True
's' False
None False
A scenario title's emphasis renders the same in every output
✓ passed 0ms
Given
a scenario title with a bold word and a code span
When
the HTML, the Markdown report and a citation show it
Books a <strong>suite</strong> with <code>late_checkout</code>
## ✓ Books a **suite** with `late_checkout`
✅ [Books a **suite** with `late_checkout`](
Then
the HTML renders the word bold and the code as code
the Markdown keeps the same markers, so a viewer renders the same
A span crossed by a term ref stays literal in every output
✓ passed 0ms
Given
a scenario title whose ** markers enclose a term ref
When
the HTML, the Markdown report and a citation show it
**Guest books**
## ✓ \*\*«Guest» books\*\*
✅ [\*\*Guest books\*\*](
Then
the HTML shows both markers as written
the Markdown escapes them, so a viewer shows them as written
A passed scenario renders as a checked heading with step bullets
✓ passed 0ms
Given
a report holding a passed scenario with three steps
When
the Markdown report is rendered
Then
the heading is checked and each step is a phase bullet
# pytest-given — proj

## ✓ Buy coffee
`tests/t.py::test_buy` · billing, happy-path

- **given** a machine
- **when** I insert \$2
- **then** I get a coffee
A line break in a scenario title or step reads as a space in the Markdown report
✓ passed 0ms
Given
a scenario whose title, and a value in its step, break across lines
When
the Markdown report is rendered
# pytest-given — proj

## ✓ line one line two
`tests/t.py::test_x`

- **when** act one act two
Then
the heading reads on one line
so does the step bullet
Structured narration renders terms, values and placeholders
✓ passed 0ms
Given
a step whose narration carries a term ref, a value and a placeholder
When
the Markdown report is rendered
Then
the term ref renders in guillemets, the value verbatim and the placeholder in braces
# pytest-given — proj

## ✓ ignored
`tests/t.py::test_parts`

- **when** a «Guest»42{amount}
A parametrized scenario renders its parameter table
✓ passed 0ms
Given
a parametrized scenario with a two-case parameter table
When
the Markdown report is rendered
Then
the heading counts the cases and the parameter table lists each row
# pytest-given — proj

## ✓ Pricing · 2 cases
`tests/t.py::test_price`

- **when** insert

| euros | expect |
|---|---|
| 1 | False |
| 2 | True |
The parameter table shows a status column only when its cases differ in status
✓ passed 0ms
Given
a parameter table whose first case is {first_status} and whose second is {second_status}
When
the Markdown report is rendered
Then
the table header reads {header}
Rendered Markdown
first_status second_status header Rendered Markdown
passed passed | coin |
Rendered Markdown
# pytest-given — proj

## ✓ Att · 2 cases
`tests/t.py::test_att`

- **when** act

| coin |
|---|
| euro |
| token |
skipped skipped | coin |
Rendered Markdown
# pytest-given — proj

## ✓ Att · 2 cases
`tests/t.py::test_att`

- **when** act

| coin |
|---|
| euro |
| token |
failed failed | coin |
Rendered Markdown
# pytest-given — proj

## ✓ Att · 2 cases
`tests/t.py::test_att`

- **when** act

| coin |
|---|
| euro |
| token |
passed skipped | coin | |
Rendered Markdown
# pytest-given — proj

## ✓ Att · 2 cases
`tests/t.py::test_att`

- **when** act

| coin | |
|---|---|
| euro | ✓ |
| token | ○ |
passed failed | coin | |
Rendered Markdown
# pytest-given — proj

## ✓ Att · 2 cases
`tests/t.py::test_att`

- **when** act

| coin | |
|---|---|
| euro | ✓ |
| token | ✗ |
A failed scenario ends with a minimal error digest
✓ passed 0ms
Given
a failed scenario carrying a two-line error and an internal frame
{
  "message": "ValueError: not sold out\nassert 1 == 0",
  "frames": [
    {
      "path": "/x/_pytest/runner.py",
      "lineno": 1,
      "func": "run",
      "code": "",
      "is_internal": true
    },
    {
      "path": "/x/tests/test_shop.py",
      "lineno": 88,
      "func": "test_sold_out",
      "code": "buy(m)",
      "is_internal": false
    }
  ],
  "error_tail": null,
  "causes": []
}
When
the Markdown report is rendered
Then
the heading is crossed and the error follows the steps
# pytest-given — proj

## ✗ Sold out
`tests/t.py::test_sold_out`

- **then** reports sold out

> ValueError: not sold out
> test_shop.py:88 in test_sold_out
only the first message line and the non-internal frame are quoted
A multi-line attachment renders as a fenced block
✓ passed 0ms
Given
a step carrying a multi-line attachment
When
the Markdown report is rendered
Then
the attachment content sits in an indented fence, not inline
# pytest-given — proj

## ✓ Multi
`tests/t.py::test_multiline`

- **then** result
    - 📎 Doc:
        ```
        line1
        line2
        ```
A skipped scenario shows its skip reason
✓ passed 0ms
Given
a skipped scenario with a reason
When
the Markdown report is rendered
Then
the heading is marked skipped and the reason follows the node ID
# pytest-given — proj

## ○ Later · skipped
`tests/t.py::test_skip` — reason: needs fixture data

- **when** act
Failure notes below a parameter table that would share a key add their row number
✓ passed 0ms
Given
three failed cases: one with the custom ID 11, one with no ID whose value is 11, and one with the ID 3
When
the Markdown report is rendered
# pytest-given — proj

## ✓ Att · 3 cases
`tests/t.py::test_att`

- **when** act

| case ID | hours |
|---|---|
| 11 | 5 |
|  | 11 |
| 3 | 3 |

- **11 (row 1)** — failed:
    > clash

- **11 (row 2)** — failed:
    > clash

- **3** — failed:
    > clash
Then
the two notes keyed 11 each add their row number
the note with a key of its own keeps it bare
The Markdown report nests steps by four spaces
✓ passed 0ms
Given
a step with a child whose attachment is multi-line
When
the Markdown report is rendered
Then
each level, its attachment and the attachment fence indent four more
A narrated citation's body is the scenario's Markdown narration without heading, anchor line or errors
✓ passed 0ms
Given
a failed grouped scenario with a tag, a skip reason and a failed case
When
its narration body is taken
Then
it holds the steps and the parameter table only
the full Markdown report contains it verbatim
The JSON report carries each sentence's coverage
✓ passed 0ms
Given
a story with a covered, an uncovered, an untracked sentence
When
the JSON report is rendered
Then
a top-level coverage lists every sentence once
the rest of the report is the input dict, unchanged
A source link config value resolves to its template
✓ passed 0ms
Given
the source link config set to {value}
When
the config value is resolved
Then
the template is {template}
value template
vscode vscode://file/{path}:{line}
cursor cursor://file/{path}:{line}
zed zed://file/{path}:{line}
pycharm pycharm://open?file={path}&line={line}
https://github.com/o/r/blob/{sha}/{relpath}#L{line} https://github.com/o/r/blob/{sha}/{relpath}#L{line}
none None
An unknown preset name is refused, with the valid ones listed
✓ passed 0ms
Given
a bareword that is neither a known preset nor a template
When
the config value is resolved
Then
the value is refused
the error names the offender and lists every valid preset
The github preset prefers GITHUB_REPOSITORY over the git remote
✓ passed 0ms
Given
GITHUB_REPOSITORY naming one repository
an origin remote naming a different one
When
the github preset is resolved
Then
the template points at the environment's repository
The github preset derives org and repo from the git origin remote
✓ passed 0ms
Given
no GITHUB_REPOSITORY, and an https origin remote
When
the github preset is resolved
Then
the blob-URL template names the remote's org and repo
The github preset refuses a remote that is not on GitHub
✓ passed 0ms
Given
no GITHUB_REPOSITORY, and an origin remote on another host
When
the github preset is resolved
Then
the preset is refused
the error points at the env var and the raw-template escape hatch
An under-anchored sentence reads as untracked until a pin covers it
✓ passed 0ms
Given
a story whose only sentence names a single term
a scenario whose step narrates that term, pinning the sentence: {pinned}
When
the story rollups are built
Then
it reads as untracked: {untracked}
pinned untracked
False True
True False
A scenario bound to two stories is listed under each
✓ passed 0ms
Given
two stories each with a guest-search-room sentence
a scenario bound to both whose step names those terms
When
the story rollups are built
Then
the scenario is listed under, and covers, both stories
A sentence is labeled by the prose of its clauses
✓ passed 0ms
Given
a story with a two-clause sentence
When
the sentence labels are built
Then
the label gives the number, then reads as prose under a story-scoped key, with the clause texts joined
A parametrized scenario takes the status of its worst case: failed, then xfailed, then passed, then skipped
✓ passed 0ms
Given
Cases of one parametrized scenario that ended {statuses}, each xfailed one for the reason "planned"
When
the grouping pass collapses them
Then
the scenario is {status}
its xfail reason is {reason}
statuses status reason
passed, failed, skipped failed None
xfailed, failed failed None
passed, xfailed xfailed planned
skipped, xfailed xfailed planned
skipped, passed passed None
skipped, skipped skipped None
A parametrized scenario carries a skip or xfail reason only when its cases all give it
✓ passed 0ms
Given
two {status} cases, one saying {first} and one saying {second}
When
the cases are grouped
Then
the parametrized scenario is {status}, with the reason {shared}
case ID status first second shared
skipped-different skipped needs a database needs a service None
skipped-shared skipped needs a database needs a database needs a database
xfailed-different xfailed flaky slow None
xfailed-shared xfailed flaky flaky flaky
A parametrized scenario keeps its place among the scenarios around it
✓ passed 0ms
Given
a plain scenario between two parametrized ones
When
the grouping pass runs
Then
the report lists them in the order the file declares
Same-named parametrized scenarios on different test functions stay apart
✓ passed 0ms
Given
two test functions whose cases share one name
When
the grouping pass runs
Then
each function keeps its own scenario and parameter table
The grouped tree comes from the first passed case
✓ passed 0ms
Given
a skipped first case and a second one that ran
When
the cases are grouped
Then
the tree is the one the passed case recorded
A plain-str narration that varies across cases is refused
✓ passed 0ms
Given
two cases whose text differs but records no parts
When
the cases are grouped
Then
the grouping is refused
the error names the test, the missing parts and the t-string fix
it names the case whose values were baked in, and the per-case opt-out
A narrated value that varies becomes a derived parameter table column
✓ passed 0ms
Given
two cases narrating a value that differs
When
templatizing walks the cases
Then
the value becomes a derived column beside the parametrize one
the step keeps a placeholder pointing at that column
the placeholder keeps the format spec and conversion it narrated
A narrated value that is the same in every case stays inline as a value highlight
✓ passed 0ms
Given
two cases narrating the same value
When
templatizing walks the cases
Then
the parameter table gains no column for it
the step keeps the value inline, as a value highlight
A varying interpolation that is not a bare name is refused
✓ passed 0ms
Given
two cases narrating a computed expression
When
the cases are grouped
Then
the grouping is refused
the error quotes the expression and shows the bind-a-local fix
A varying expression in a then is refused with the fix of an expected-outcome column
✓ passed 0ms
Given
two cases whose then narrates an outcome derived from an input
When
the cases are grouped
Then
the grouping is refused
the error first suggests parametrizing the expected outcome
A parameter table cell reads the way the scenario title formats it
✓ passed 0ms
Given
a Template scenario title formatting its parameter
When
the cases are grouped
Then
the cells carry the formatting the title declared
A scenario title formatting a parameter unlike a step gets its own column
✓ passed 0ms
Given
a title formatting the parameter and a step reading it plainly
When
the cases are grouped
Then
the title points at a column holding what it renders
the title renders the disambiguated token, text and parts agreeing
A step formatting a parameter unlike the scenario title gets its own column
✓ passed 0ms
Given
a step formatting the parameter and a title reading it plainly
When
the cases are grouped
Then
the step points at a column holding what it renders
the step renders the disambiguated token, text and parts agreeing
A step whose narrated value differs from its parameter column is refused
✓ passed 0ms
Given
two cases narrating a value their column lacks
When
the cases are grouped
Then
the grouping is refused
the error names the column and what the case actually narrated
A term ref whose display differs between cases is refused
✓ passed 0ms
Given
two cases whose term ref reads differently
When
the cases are grouped
Then
the grouping is refused
the error names the term ref and the split-it-out fix
A term ref whose display varies is refused even when a parametrize value binds it
✓ passed 0ms
Given
two cases whose term ref is the parameter itself
When
the cases are grouped
Then
the grouping is refused
the error points at the per-case scenario opt-out
A parameter table orders its columns the way the narration first shows them
✓ passed 0ms
Given
two cases whose given attaches a varying log and whose later step narrates the parameter
When
templatizing walks the cases
Then
the given's attachment column comes first
each case row follows the same order
An attachment whose payload varies becomes an attachment column
✓ passed 0ms
Given
two cases attaching a label with differing payloads
When
templatizing walks the cases
Then
the payload moves into an attachment column
the step keeps a content-less badge pointing at it
A step whose set of attachment labels differs between cases is refused
✓ passed 0ms
Given
an attachment label only one case attaches
When
the cases are grouped
Then
the grouping is refused
the error names the label, the case, and asks for a constant one
A parameter table cell holds the text the step pointing at it narrated
✓ passed 0ms
Given
two cases narrating a parameter with a format spec
When
grouping builds the parameter table
Then
each cell carries the formatted text, under one column
the step keeps its placeholder, which that cell substitutes into
Cases that narrate different steps are refused rather than grouped
✓ passed 0ms
Given
two cases whose step trees differ
When
the cases are grouped
Then
the grouping is refused
the error names the divergence and the opt-out that answers it
A failed case must narrate the steps it shares with the passed ones the same way
✓ passed 0ms
Given
two cases whose step texts differ
When
the cases are grouped
Then
the grouping is refused
the error names the failed case and its difference from the baseline
A failed case that stops early or takes another path still groups
✓ passed 0ms
Given
a passed case that loads its items, then checks it is hot
a failed case that loads its items, then retries instead of checking it is hot: {retries}
failed steps
When
the cases are grouped
Then
they make one scenario, with a row for each case
case ID retries failed steps
stops-early False
failed steps
when 4 items load
parts-from-the-baseline True
failed steps
when 4 items load
when it retries
A step narrating a glossary term parameter keeps pointing at its parameter table column
✓ passed 0ms
Given
a step narrating a parameter bound to a glossary term instance
When
the cases are grouped
Then
the parameter table holds the term displays alone
the step still points at that column
A per-case scenario title ends with its case ID as a value
✓ passed 0ms
Given
a parametrized scenario titled "Split" that declines the grouping, with the case ID abc
When
its case becomes a scenario of its own
Then
the title reads "Split [abc]"
the case ID is a value part, and its asterisks are not read as emphasis
Adopt pytest-given
13 sentences43 scenarios
Domain ExperttellsStoryto theDeveloper
tell no coverage
DevelopercapturesStoryasSentence
capture 3 scenarios
DeveloperbuildsGlossarywith theDomain Expert
build 3 scenarios
AgentwritesScenariowithTagagainst theGlossary
write 1 scenario
AgentnarratesStepwith aPhase
narrate 3 scenarios
AgentattachesAttachmentto aStep
attach 1 scenario
CollectorrecordsStepon theStep stack
record 3 scenarios
CollectorgraftsFixture recordingfrom aStep fixture
graft 7 scenarios
CollectorgroupsParametrized scenariointo aParameter table
group 5 scenarios
RenderermatchesScenarioto aSentence
match 4 scenarios
RendererrendersReportwithParameter coloring
render 1 scenario
Narration lintflagsScenarioagainst aLint rule
flag 12 scenarios
Domain ExpertreviewsScenarioin theReport
review no coverage
Scenarios
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Glossary
63 terms 6 actors 16 work objects 2 activities 39 uncategorized
Actors
Collector
What gathers a session's scenarios, fixture recordings and parameter info.
1 story9 scenarios
Renderer
Converts a JSON report into a rendering — a self-contained HTML page or a Markdown document.
1 story3 scenarios
Narration lint
The --given-lint pass that checks recorded scenarios against the Lint rule catalog. It enforces the structural subset of the narration conventions — it cannot check whether a Step's text is semantically true.
1 story14 scenarios
Developer
Person who writes the application code and — together with the Agent — the scenarios; curates the glossary with the Domain Expert.
1 story
No scenario uses this term.
Domain Expert
Person who owns the domain knowledge and the ubiquitous language; source of domain stories and reviewer of scenarios and reports. A stakeholder in the broad sense.
1 story
No scenario uses this term.
Agent
AI coding agent that authors and maintains scenarios alongside the Developer, guided by the pytest-given skills.
1 story
No scenario uses this term.
Work Objects
Scenario
A test that narrates the rule it demonstrates, marked with @scenario. Tests without the mark stay out of the report.
1 story62 scenarios
Step
A unit of narration in one Phase. Steps nest and may carry Attachments, but have no status or error of their own: a failure belongs to the Scenario, and to its Case in a Parameter table.
1 story60 scenarios
Phase
The category of a step: given, when, or then. A step has exactly one phase.
1 story3 scenarios
Tag
A free-form label on a scenario. A / nests it: ticket/ABC-123 sits under ticket.
1 story3 scenarios
Attachment
A labeled piece of text or JSON bound to the step being narrated.
1 story8 scenarios
Parametrized scenario
A Scenario whose test is parametrized, so it runs once per Case. pytest-given groups the results.
1 story12 scenarios
Parameter table
The per-scenario table of cases and columns. A column is a param (a parametrize input), a derived (a narrated value that varies across cases) or an attachment (an attachment whose payload varies).
1 story16 scenarios
Step fixture
A pytest fixture that narrates its setup as a given Step. A fixture cannot narrate when or then.
1 story5 scenarios
Fixture recording
The steps and attachments a step fixture narrates during setup. A generator fixture's teardown records nothing — it refuses steps and attachments.
1 story6 scenarios
Step stack
The chain of currently-open steps. Opening a step adds it, and leaving its block removes it.
1 story1 scenario
Report
The output artifact: a JSON data file and optional self-contained HTML and Markdown renderings derived from it. The JSON is the source of truth.
1 story57 scenarios
Parameter coloring
Each parametrize column gets a stable highlight color; placeholders and matching values share that color wherever they appear in step text and the parameter table.
1 story1 scenario
Lint rule
One named check, carrying a surface and a default Severity. A runtime rule reads the recorded scenarios; an ast rule parses the step bodies' source.
1 story12 scenarios
Glossary
The shared vocabulary a domain speaks in: its Ubiquitous Language.
1 story13 scenarios
Story
A named flow modeled as a sequence of sentences. Stories are the unit of coverage.
1 story40 scenarios
Sentence
What Domain Storytelling calls a sentence: an actor, an activity and its work objects, plus connective words. One row in a story, numbered by its position and optionally named, a name that stays put when rows are inserted. Usually one clause; several when the sentence has several arrows under one number.
1 story35 scenarios
Activities
Group
Collapsing the cases of a parametrized scenario into one logical scenario carrying a Parameter table. Cases group when they share both the same name and the same Node ID without its parametrize tail — one test function; two same-named scenarios on different test functions stay separate. @scenario(group_parametrized=False) declines the merge, so each case lives on as its own scenario.
1 story23 scenarios
Graft
Attaching a fixture recording into the active scenario's step tree at the moment its host test starts.
1 story5 scenarios
Uncategorized
Scenario title
The statement of the rule a Scenario demonstrates. Not the test function's name, which the Node ID carries.
12 scenarios
Narration
The human-readable text on a step or scenario title, which may mix plain text with values, placeholders and term refs.
11 scenarios
when_then
One block that narrates a when action and its then outcome as two sibling steps. Used mainly to narrate an expected raise, so the action and its outcome stay distinct steps.
4 scenarios
Case
One row of a parametrized scenario: its node ID, its parameter values, its status and any error.
32 scenarios
Case ID
A Case's pytest ID: its Node ID's parametrize tail without the brackets (touching-edges), as the terminal prints it. Custom when it is more than its values' generated parts, as from pytest.param(..., id=...) or ids=.
2 scenarios
Templatize
Derive the grouped-template step text by comparing every comparable case: what all of them share stays inline, and anything that varies points at a parameter-table column. The baseline comes from the first passed case, and every other passed case must narrate that same template — a failed case too, over the steps it shares with the baseline.
4 scenarios
Plain fixture
A pytest fixture without a pytest-given decorator. It produces no step in the report unless a Given annotation on the test's parameter narrates it.
3 scenarios
Given annotation
A given(...) in a test parameter's Annotated[...] type: def test(room: Annotated[int, given('a room')]). On a parametrize value or a Plain fixture it adds a childless given step; on a Step fixture it replaces the fixture's root label and its pins. Only given is allowed, and a Template in it may only hold a bare parametrize column.
6 scenarios
Active scenario
The scenario currently being recorded into.
11 scenarios
Node ID
A pytest test identifier (e.g., tests/test_x.py::test_y[a-b]).
2 scenarios
Value highlight
A neutral highlight applied to t-string interpolation values that don't correspond to a parametrize column and are constant across every case (e.g., a computed expression like price * 1.2). One that varies becomes a derived column instead.
1 scenario
Source link
A link to a file and line: a scenario's test function, or the declaration of a Story or Term.
5 scenarios
Report link
A Markdown link to a scenario, tag or story in the HTML Report. Without a glyph it is a plain one, which claims only that its target exists.
5 scenarios
Citation
A Report link led by its target's status glyph, citing a scenario, tag or story from a Markdown document: ✅ [title](<report URL>#scenario=…). A tag or story citation adds a summary after it, (5 ✅ · 2 🔵). A target the Report lacks reads ❓.
15 scenarios
Narrated citation
A Citation of a scenario written as a collapsible block, the citation as its summary and the scenario's Markdown narration as its body.
8 scenarios
Citation finding
One problem pytest-given citations check reports on one Report link: its kind (stale, missing, failed, mistyped, …), the document location and a message.
7 scenarios
Theme
The HTML report's colour scheme — light, dark, or auto (follow the viewer's system).
2 scenarios
Lint finding
One Lint rule firing on one subject: the rule id, the Severity it fired at, the subject, a Source link location and a message naming the offender.
13 scenarios
Severity
A Lint rule's level — off, warn or error. Only error fails the run, warn reports in the terminal summary, and an off rule is not evaluated at all.
5 scenarios
File glossary
A glossary loaded from the GFM pipe tables of a Markdown file.
23 scenarios
Deferred term
A term handed over before its kind is settled: what g('foo') and g['foo'] on a code glossary return, and a file glossary lookup of a row with no declared kind. Kind inference settles it later.
2 scenarios
Term
A glossary entry: an Actor, Work Object, Activity, or kindless term. Each carries an id (slug), a canonical name, a kind unless kindless, and an optional definition.
50 scenarios
Handle
What a glossary hands back for a term, the same from every accessor (g.actor(...), g('foo'), g['Guest'], a captured guest = ...). It is what steps, scenario titles and sentences interpolate, in one of four surface forms: bare (room — the canonical display), .l (room.l — capitalized words lowercased, acronyms kept), .s (room.s — the S-form), or called (room('Deluxe Suite') — an instance on an Actor or Work Object, an inflection on an Activity). .l and .s also apply to a called form and chain (room.l.s reads rooms). Each form renders as a term ref. A story hands out a sentence handle the same way: book_a_room['cancel'] by name or book_a_room[3] by number, which pins= takes.
5 scenarios
S-form
A term's name with the regular English -s ending, from the .s handle form: the plural of an Actor or Work Object (rooms), the third person singular of an Activity (books). It adds -s to the last word, -es after s, x, z, ch or sh, and turns a consonant + y into -ies, but an acronym takes a plain -s (APIs); anything else, such as people or checks in, needs the called form. An S-form reference, in any case, is a reference to the term itself — not an instance or an inflection.
3 scenarios
Actor
A glossary term for a participant in the domain (e.g., Guest).
16 scenarios
Work Object
A glossary term for a thing acted on (e.g., Room, Booking).
5 scenarios
Activity
A glossary term for what an actor does (e.g., book, confirm), which Domain Storytelling draws as an arrow labelled with a verb. Activities accept inflections: calling search('searches for') records searches for as a surface form of the canonical search.
10 scenarios
Term ref
An occurrence of a term inside narration or a clause.
18 scenarios
Instance
A named refinement of an Actor or Work Object (e.g., guest('Alice') is an instance of the Guest actor).
10 scenarios
Inflection
A surface form of an Activity term other than its canonical name or S-form (e.g., searches for as an inflection of search).
8 scenarios
Clause part
A piece of a clause's prose: a term ref, or a bare clause word. A bare clause word — a node label or edge connective — carries no kind or id, is never classified by inference, and never reaches the glossary. That last is what separates it from a kindless term, which has an id and is tracked.
4 scenarios
Clause
One linear walk through a sentence's arrows, a node/edge alternation starting actor → verb → noun. A sentence with several arrow chains under one number, such as an actor handing a work object to two recipients, takes one clause per chain. Domain Storytelling names no such unit.
19 scenarios
Slot
A position role in a clause, from its node/edge alternation: position 0 is the actor slot, odd positions are verb slots, and even positions ≥ 2 are noun slots.
11 scenarios
Scenario↔sentence binding
The link between a scenario (or step) and story sentences. @scenario(stories=...) names the stories a scenario is narration-matched against; a pin (pins= on @scenario or on given/when/then) binds sentences explicitly, in any story, whether stories= names it or not.
1 scenario
Pin
What a sentence handle passed to pins= is recorded as, the way a term handle in narration is recorded as a term ref: a reference to a story and a sentence number. A pin binds explicitly and replaces narration matching — a step pin for that step, a scenario pin (@scenario(pins=...)) for every step of the scenario, which then covers its own pins plus its steps'. pins=[] pins nothing but still opts out of narration matching. A pin reaches under-anchored sentences too.
9 scenarios
Coverage
The "did this scenario touch that sentence" relation. A sentence is covered when the set of terms it references is a subset of the terms a single step references — matching is per step, not against the union across steps, and on terms, not surface forms: an instance or inflection counts as its term. A pin covers its sentences directly instead, regardless of narration or term count.
11 scenarios
Kind inference
The pass that assigns each undeclared term a kind from the slot positions it occupies across all story sentences; declared kinds are verified against observed positions instead. A term used in incompatible slots (or conflicting with its declared kind) raises. A term never referenced by any sentence stays kindless.
8 scenarios
Kindless
A term with no kind, because kind inference finds no story slot to infer from (a term used only in t-string steps, never in a sentence).
8 scenarios
Undefined
A term with no definition. Orthogonal to kindless.
1 scenario
No terms match this filter.