When source fields are strings, not collections, raise an error; Test deferred sources addresses error
Review Request #3970 - Created June 3, 2016 and submitted
|Nick Howard (Twitter)|
|benjyw, jsirois, kwlzn, zundel|
Currently if a string is passed to sources in a target definition, it will be treated as a list of single character filenames, which blows up in a confusing way later. This makes passing a string an error.
While I was in here, I added unit tests covering the too many addresses case for deferred sources and uncovered a bug where if the address kwarg isn't passed, instead of raising WrongNumberOfAddresses, it would instead hit an AttributeError on None.
Wrote a few regression tests and made them pass.
Jenkins and travis passed
lgtm. would it make sense to also fix this for the v2 engine as well?
with this RB patched in, I noticed that
./pants list bad_targetfails gracefully as intended while
./pants --enable-v2-engine list bad_targetsilently succeeds. it'd be great to aim for parity between these two modes for fixes going forward.