Catch exception if the distribution is not found#472
Conversation
There was a problem hiding this comment.
looks mostly good. can you please also update the AUTHORS and CHANGES.rst document?
are you familiar with pytest's monkeypatch fixture? that would be the only feasible way to test your addition. as the problem is small here, it's actually a good opportunity to get a grip on it.
|
sorry, i forgot that the code to be tested it executed at module evaluation. the unit-testable approach would be to put the questionable in a function and call that from the module body. i'd say do as you like. |
|
Agreed; I also had this in mind at the beginning. Another solution would be to mock the |
When the distribution of Cerberus cannot be found, catch the exception instead of raising an error and exiting the program. This allows to consume the package without installing it, e.g. as a git submodule. In the exception case the __version__ string is set to `unknown`. Fixes pyeve#471
79b6c7c to
77ec23a
Compare
funkyfuture
left a comment
There was a problem hiding this comment.
i was quiet distracted during the review, please excuse if i may have confused something on the way.
This includes: * moving the tests from test_init.py into test_assorted.py * rely on PYTHON_VERSION variable rather than the nested try/except * monkeypatch inside the test function and get rid of cerberus fixture
|
Thanks for the review, @funkyfuture. Your suggestions made perfect sense to me. |
|
merged w/ 7896257 |
|
thanks a lot for your contribution! |
When the distribution of Cerberus cannot be found, catch the exception
instead of raising an error and exiting the program. This allows to
consume the package without installing it, e.g. as a git submodule. In
the exception case the version string is set to
unknown.Fixes #471