Skip to content

If you have just one story in your collection, you can run it directly by using .one().

Code Example

example.story:

Do thing:
  steps:
    - Do thing
engine.py:

from hitchstory import BaseEngine
from code_that_does_things import *

class Engine(BaseEngine):
    def do_thing(self):
        pass

With code:

from hitchstory import StoryCollection
from pathlib import Path
from engine import Engine


story = StoryCollection(Path(".").glob("*.story"), Engine()).one()
story.play()

Will output:

RUNNING Do thing in /path/to/working/example.story ... SUCCESS in 0.1 seconds.

Executable specification

Documentation automatically generated from one-story.story storytests.