uber/charlatan

Nested custom constructors are not evaluated

Opened this issue · 1 comments

kooba commented

This could be a problem with pyyaml itself.

When creating fixtures without models and nesting !now only first level is evaluated

This yaml definition:

simple_dict:
  fields:
    created_at: !now
    nested:
      created_at: !now

produces this output:

{ 
    'created_at': datetime.datetime(2015, 11, 25, 17, 27, 3, 119923, tzinfo=<UTC>), 
    'nested': {
        'created_at': <function configure_yaml.<locals>.now_constructor.<locals>.get_now at 0x1052cbbf8>
    }
}

Cheers,
Jakub

Yes, unfortunately right now that's expected, we stop at the first nesting level.

We could add the other levels.