Separating Input Acquisition and Parsing

A parser uses supplied bytes or text to recover values. A separate reader can decide where the input comes from and when resources close.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace a configuration load
  2. Check a real input path too

Trace a configuration load

A file layer reads text with an explicit encoding and supplies the resulting characters to a parser. Malformed syntax can be tested without opening a file. See explicit decoding.

Check a real input path too

Test loading a valid fixture from disk, with its encoding and path behavior. Integration tests verify the link between the otherwise independent stages.[1]

References

  1. Python Software Foundation, Python Tutorial: Classes ↩