diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-07-29 14:49:58 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-07-29 14:49:58 -0400 |
commit | 7f10b40347b2dd48e270ab23c8e6dded5fed7a16 (patch) | |
tree | ea7820c5bfcbcd26842d56bcbef83cc2339fdbd9 | |
parent | cfaf79d5b5cf4eb3611ddf24a723a884a568436b (diff) | |
download | pytest-runner-7f10b40347b2dd48e270ab23c8e6dded5fed7a16.tar.gz |
Combine named and unnamed extras handling.2.6.1
-rw-r--r-- | ptr.py | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -63,16 +63,16 @@ class PyTest(orig.test): self._build_egg_fetcher() if self.distribution.install_requires: self.distribution.fetch_build_eggs(self.distribution.install_requires) - # include environment-specific unnamed environment markers - for spec, reqs in self.distribution.extras_require.items(): - name, sep, marker = spec.partition(':') - if not name and self.marker_passes(marker): - self.distribution.fetch_build_eggs(reqs) if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) - if self.distribution.extras_require and self.extras: - list(map(self.distribution.fetch_build_eggs, - self.distribution.extras_require.values())) + extras_require = self.distribution.extras_require or {} + for spec, reqs in extras_require.items(): + name, sep, marker = spec.partition(':') + if not self.marker_passes(marker): + continue + # always include unnamed extras + if not name or self.extras: + self.distribution.fetch_build_eggs(reqs) if self.dry_run: self.announce('skipping tests (dry run)') return |