alecthomas / voluptuous

CONTRIBUTIONS ONLY: Voluptuous, despite the name, is a Python data validation library.
https://pypi.org/project/voluptuous
BSD 3-Clause "New" or "Revised" License
1.82k stars 218 forks source link

Added support for default values in Inclusive schemas #382

Closed nickovs closed 5 years ago

nickovs commented 5 years ago

This is a trivial implementation of a fix for #381.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 95.404% when pulling d6e83a6b4aa29e1c18361a0057b5fdae9b00f251 on nickovs:inclusive-defaults into 806d1c5954b82b51e69f03c80ec3bfbb4c6b3192 on alecthomas:master.

svisser commented 5 years ago

It's a trivial change but I think there should be a test case to ensure that this is automatically tested and continues to behave as expected.

nickovs commented 5 years ago

I did think about that. Right now there is no test case for Inclusive at all other than checking that the description works (the same goes for Exclusive. If I get a moment I'll look at writing a test suite for them both.

nickovs commented 5 years ago

@svisser I created a set of new tests for both Inclusive and Exclusive, for the input cases of an empty input, one of the variables and all of the variables, with and without default values for the Inclusive case.

svisser commented 5 years ago

It seems a useful change to make to me.

Given that it's new functionality, I wonder if @alecthomas has an opinion on this?