Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display valid Enum values in Coerce #450

Merged
merged 1 commit into from
Mar 10, 2022
Merged

Conversation

epenet
Copy link
Contributor

@epenet epenet commented Feb 15, 2022

No description provided.

@epenet
Copy link
Contributor Author

epenet commented Feb 15, 2022

Sample message: "expected EntityCategory or one of ['config', 'diagnostic', 'system']"

@epenet
Copy link
Contributor Author

epenet commented Mar 8, 2022

Sorry to chase, but is it likely to be considered? Or should it be handled inside Home Assistant?

@alecthomas
Copy link
Owner

alecthomas commented Mar 8, 2022

Seems reasonable. Do the tests pass? I haven't set up CI since Travis died.

@epenet
Copy link
Contributor Author

epenet commented Mar 8, 2022

They do on my machine:

nosetests
.......................................................................................................................................................................................
----------------------------------------------------------------------
Ran 183 tests in 0.088s

OK

@epenet
Copy link
Contributor Author

epenet commented Mar 8, 2022

Added tests:

nosetests --with-coverage --cover-package=voluptuous
........................................................................................................................................................................................
Name                           Stmts   Miss  Cover
--------------------------------------------------
voluptuous/__init__.py             6      0   100%
voluptuous/error.py               78      2    97%
voluptuous/humanize.py            22      7    68%
voluptuous/schema_builder.py     509     18    96%
voluptuous/util.py                63      7    89%
voluptuous/validators.py         460     13    97%
--------------------------------------------------
TOTAL                           1138     47    96%
----------------------------------------------------------------------
Ran 184 tests in 0.139s

OK

@alecthomas
Copy link
Owner

Would you mind formatting this without the list brackets? eg. one of 1, 2, 3 or one of 'one', 'two', 'three'`

@epenet
Copy link
Contributor Author

epenet commented Mar 10, 2022

Adjusted without the brackets, and added tests for a string enum.

nosetests --with-coverage --cover-package=voluptuous
........................................................................................................................................................................................
Name                           Stmts   Miss  Cover
--------------------------------------------------
voluptuous/__init__.py             6      0   100%
voluptuous/error.py               78      2    97%
voluptuous/humanize.py            22      7    68%
voluptuous/schema_builder.py     509     18    96%
voluptuous/util.py                63      7    89%
voluptuous/validators.py         460     13    97%
--------------------------------------------------
TOTAL                           1138     47    96%
----------------------------------------------------------------------
Ran 184 tests in 0.132s

OK

@alecthomas
Copy link
Owner

Perfect, thank you so much!

@alecthomas alecthomas merged commit 6cf017e into alecthomas:master Mar 10, 2022
@epenet epenet deleted the patch-1 branch March 11, 2022 06:39
@epenet
Copy link
Contributor Author

epenet commented Mar 11, 2022

Thanks 👍

@epenet
Copy link
Contributor Author

epenet commented Mar 11, 2022

Let me know when the release is available...

@epenet
Copy link
Contributor Author

epenet commented Mar 22, 2022

Any luck with the release ?

@jamesbraid
Copy link

This broke for py2.7, homepage still lists py2.7 as being supported... what to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants