Skip to content
HitchDev
Index
Initializing search
HitchDev
About
Contact me
Approach
Approach
Communal commenting
The Technical Debt Dial
Contributing
Contributing
Commits
Extreme dogfooding
HitchDev Principles
Semantic versioning
Code quality
Code quality
Consistency
Consistency
Determinism
Determinism
Fail fast fail clearly
Fail fast fail clearly
Isolation
Isolation
Least code
Least code
Least expressive power
Least expressive power
Naming
Naming
Tooling
Tooling
Commandlib
Commandlib
Changelog
Using
Using
Alpha
Alpha
Add directory to PATH (with_path)
Capture output (.output())
Easily invoke commands from one directory (CommandPath)
Change your command's environment variables (with_env)
Run command and don't raise exception on nonzero exit code (ignore_errors())
Piping data in from string or file (.piped)
Piping data out to string or file (.piped)
Run commmands interactively using icommandlib or pexpect
Easily invoke commands from the current virtualenv (python_bin)
Faketime
Faketime
Hitchrunpy
Hitchrunpy
Changelog
Using
Using
Alpha
Alpha
Cprofile
Environment vars
Exceptions
Interact with running code
Setup code
Syntax errors
Timeout
Variables
Hitchstory
Hitchstory
Changelog
Approach
Approach
Can I do BDD with hitchstory? How do I do BDD with hitchstory?
Recommended complementary tools
Executable specifications
Flaky Tests
Does hitchstory let your BA or Product Manager write stories while you just write the code?
Recommended Environment
Screenplay Principle
How can executable specifications and living documentation be used for stakeholder collaboration?
Tests are an investment
What is the difference betweeen a test and a story?
The importance of test realism
What is a testing and living documentation framework?
Testing non-deterministic code
Triality
Using
Using
Alpha
Alpha
Abort a story with ctrl-C
Continue on failure when playing multiple stories
Hiding stacktraces for expected exceptions
Handling failing tests
Flaky story detection
Generate documentation from stories
Given preconditions
Gradual typing of story steps
Inherit one story from another
Extra story metadata - e.g. adding JIRA ticket numbers to stories
Story with parameters
Play multiple stories in sequence
Story that rewrites itself
Running a single named story successfully
Shortcut lookup for story names
Special exception named failure
Arguments to steps
Strong typing
Variations
Why
Why
Two Unit Tests, Zero Integration Tests
Declarative User Stories
Why does hitchstory mandate the use of given but not when and then?
Why is inheritance a feature of hitchstory stories?
Why does hitchstory not have an opinion on what counts as interesting to "the business"?
Why does hitchstory not have a command line interface?
Principles
Why programatically rewrite stories?
Why does HitchStory use StrictYAML?
Why not
Why not
Why not use Behave, Lettuce or Cucumber (Gherkin)?
Why not use the Robot Framework?
Why use hitchstory instead of a unit testing framework?
Seleniumdirector
Seleniumdirector
Changelog
Using
Using
Alpha
Alpha
Attributes
Disappearing element
Element should be on top
Hovering over an element
Html classes
Html element contents
Html ids
Iframe
Should contain text
Subelements
Using selenium element object
Why not
Why not
Why not use Capybara-Py or Splinter?
Why not use the page object pattern?
Why not use Robot SeleniumLibrary?
Strictyaml
Strictyaml
Changelog
What YAML features does StrictYAML remove?
What is YAML?
When should I use a validator and when should I not?
Using
Using
Alpha
Alpha
Compound
Compound
Fixed length sequences (FixedSeq)
Mappings combining defined and undefined keys (MapCombined)
Mappings with arbitrary key names (MapPattern)
Mapping with defined keys and a custom key validator (Map)
Using a YAML object of a parsed mapping
Mappings with defined keys (Map)
Optional keys with defaults (Map/Optional)
Validating optional keys in mappings (Map)
Sequences of unique items (UniqueSeq)
Sequence/list validator (Seq)
Updating document with a schema
Howto
Howto
Build a YAML document from scratch in code
Either/or schema validation of different, equally valid different kinds of YAML
Labeling exceptions
Merge YAML documents
Revalidate an already validated document
Reading in YAML, editing it and writing it back out
Get line numbers of YAML elements
Parsing YAML without a schema
Restrictions
Restrictions
Disallowed YAML
Duplicate keys
Dirty load
Scalar
Scalar
Boolean (Bool)
Parsing comma separated items (CommaSeparated)
Datetimes (Datetime)
Decimal numbers (Decimal)
Email and URL validators
Empty key validation
Enumerated scalars (Enum)
Floating point numbers (Float)
Hexadecimal Integers (HexInt)
Integers (Int)
Validating strings with regexes (Regex)
Parsing strings (Str)
Why
Why
What is wrong with duplicate keys?
What is wrong with explicit tags?
What is wrong with flow-style YAML?
The Norway Problem - why StrictYAML refuses to do implicit typing and so should you
What is wrong with node anchors and references?
Why does StrictYAML not parse direct representations of Python objects?
Why does StrictYAML only parse from strings and not files?
Why is parsing speed not a high priority for StrictYAML?
What is syntax typing?
Why does StrictYAML make you define a schema in Python - a Turing-complete language?
Why not
Why not
Why avoid using environment variables as configuration?
Why not use HJSON?
Why not HOCON?
Why not use INI files?
Why not use JSON Schema for validation?
Why not JSON for simple configuration files?
Why not JSON5?
Why not use the YAML 1.2 standard? - we don't need a new standard!
Why not use kwalify with standard YAML to validate my YAML?
Why not use Python's schema library (or similar) for validation?
Why not use SDLang?
What is wrong with TOML?
Why shouldn't I just use Python code for configuration?
Why not use XML for configuration or DSLs?
Tropes
Tropes
Begging for refactoring time
Code coveragism
Goodhart's Tests
Mimetic Tests
No Shit Sherlock Comments
Refactoring smuggling
The Unit Test Paradox
We don't have time for technical debt
Table of contents
title: Using StrictYAML v0.x.x
Index
title: Using StrictYAML v0.x.x