When source fields are strings, not collections, raise an error; Test deferred sources addresses error

Review Request #3970 - Created June 3, 2016 and submitted

Information
Nick Howard (Twitter)
pants
3507, 3550
Reviewers
pants-reviews
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

  • http://jenkins.pantsbuild.org/job/pantsbuild/job/pants/branch/PR-3550/1/
  • https://travis-ci.org/pantsbuild/pants/builds/135065849
Nick Howard (Twitter)
Benjy Weinberger
Kris Wilson
Eric Ayers
Nick Howard (Twitter)
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted as https://github.com/pantsbuild/pants/commit/4b58f02549d400cb9ed95039230eb607b3d1a62d
Loading...