Skip to content

Commit

Permalink
test(*): fix warnings when running tests on Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rubik committed Sep 10, 2018
1 parent b9f5ffd commit 9ac4f7c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions radon/tests/test_cli_harvest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import collections
import collections.abc

import pytest

Expand All @@ -8,7 +8,7 @@


BASE_CONFIG = Config(
exclude='test_[^.]+\.py',
exclude=r'test_[^.]+\.py',
ignore='tests,docs',
)

Expand Down Expand Up @@ -100,7 +100,7 @@ def test_base_to_terminal_not_implemented(base_config):
def test_base_run(base_config):
h = harvest.Harvester(['-'], base_config)
h.gobble = fake_gobble
assert isinstance(h.run(), collections.Iterator)
assert isinstance(h.run(), collections.abc.Iterator)
assert list(h.run()) == [('-', 42)]
h.gobble = fake_gobble_raising
assert list(h.run()) == [('-', {'error': 'mystr'})]
Expand All @@ -110,10 +110,10 @@ def test_base_results(base_config):
h = harvest.Harvester([], base_config)
h.run = fake_run
results = h.results
assert isinstance(results, collections.Iterator)
assert isinstance(results, collections.abc.Iterator)
assert list(results) == [{'file-0': 0}, {'file-1': 1}, {'file-2': 4}]
assert not isinstance(h.results, collections.Iterator)
assert isinstance(h.results, collections.Iterable)
assert not isinstance(h.results, collections.abc.Iterator)
assert isinstance(h.results, collections.abc.Iterable)
assert isinstance(h.results, list)


Expand Down

0 comments on commit 9ac4f7c

Please sign in to comment.