Skip to content

Commit b88f5e8

Browse files
committed
Simplify series plotting test
Extra lint
1 parent f40d7da commit b88f5e8

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

pandas/tests/plotting/test_series.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
""" Test cases for Series.plot """
44

55

6-
import itertools
6+
from itertools import chain
77
import pytest
88

99
from datetime import datetime
@@ -333,8 +333,7 @@ def test_pie_series(self):
333333
autopct='%.2f', fontsize=7)
334334
pcts = ['{0:.2f}'.format(s * 100)
335335
for s in series.values / float(series.sum())]
336-
iters = [iter(series.index), iter(pcts)]
337-
expected_texts = [next(it) for it in itertools.cycle(iters)]
336+
expected_texts = list(chain.from_iterable(zip(series.index, pcts)))
338337
self._check_text_labels(ax.texts, expected_texts)
339338
for t in ax.texts:
340339
assert t.get_fontsize() == 7

versioneer.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -606,11 +606,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
606606
if verbose:
607607
print("keywords are unexpanded, not using")
608608
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
609-
refs = set(r.strip() for r in refnames.strip("()").split(","))
609+
refs = {r.strip() for r in refnames.strip("()").split(",")}
610610
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
611611
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
612612
TAG = "tag: "
613-
tags = set(r[len(TAG):] for r in refs if r.startswith(TAG))
613+
tags = {r[len(TAG):] for r in refs if r.startswith(TAG)}
614614
if not tags:
615615
# Either we're using git < 1.8.3, or there really are no tags. We use
616616
# a heuristic: assume all version tags have a digit. The old git %%d
@@ -619,7 +619,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
619619
# between branches and tags. By ignoring refnames without digits, we
620620
# filter out many common branch names like "release" and
621621
# "stabilization", as well as "HEAD" and "master".
622-
tags = set(r for r in refs if re.search(r'\d', r))
622+
tags = {r for r in refs if re.search(r'\d', r)}
623623
if verbose:
624624
print("discarding '%%s', no digits" %% ",".join(refs-tags))
625625
if verbose:
@@ -960,11 +960,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
960960
if verbose:
961961
print("keywords are unexpanded, not using")
962962
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
963-
refs = set(r.strip() for r in refnames.strip("()").split(","))
963+
refs = {r.strip() for r in refnames.strip("()").split(",")}
964964
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
965965
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
966966
TAG = "tag: "
967-
tags = set(r[len(TAG):] for r in refs if r.startswith(TAG))
967+
tags = {r[len(TAG):] for r in refs if r.startswith(TAG)}
968968
if not tags:
969969
# Either we're using git < 1.8.3, or there really are no tags. We use
970970
# a heuristic: assume all version tags have a digit. The old git %d
@@ -973,7 +973,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
973973
# between branches and tags. By ignoring refnames without digits, we
974974
# filter out many common branch names like "release" and
975975
# "stabilization", as well as "HEAD" and "master".
976-
tags = set(r for r in refs if re.search(r'\d', r))
976+
tags = {r for r in refs if re.search(r'\d', r)}
977977
if verbose:
978978
print("discarding '%s', no digits" % ",".join(refs-tags))
979979
if verbose:

0 commit comments

Comments
 (0)