create_outputs and scanning declare expected with a default of None but dereference expected.get(...) unconditionally, so calling either without it raises AttributeError, although the parameter is documented optional.
Guard the expected-value checks with if expected is not None:. The self-test, which always passes expected, is unaffected; a standalone call with expected=None now returns its result instead of raising.
If the harness coupling is intentional, I am happy to close this or turn it into a docs note instead.