Skip to content

Commit

Permalink
Merge pull request #10 from gonzigaran/master
Browse files Browse the repository at this point in the history
Tweepy 3.7 support
  • Loading branch information
michaelbrooks committed Aug 14, 2020
2 parents 1ea5f4a + 36c73c0 commit dc9846b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -29,7 +29,7 @@
],

install_requires=[
"tweepy >= 3.0"
"tweepy >= 3.7"
],
test_suite="tests",
tests_require=["mock == 1.0.1"],
Expand Down
6 changes: 3 additions & 3 deletions tests/test_stream.py
Expand Up @@ -72,7 +72,7 @@ def test_start_unfiltered_no_terms(self):
retry_count=self.retry_count)

# It should be using the sample endpoint
self.tweepy_stream_instance.sample.assert_called_once_with(async=True, languages=None)
self.tweepy_stream_instance.sample.assert_called_once_with(is_async=True, languages=None)

def test_start_with_languages(self):

Expand All @@ -89,7 +89,7 @@ def test_start_with_languages(self):
self.stream.start_stream()

# It should be using the sample endpoint with languages
self.tweepy_stream_instance.sample.assert_called_once_with(async=True, languages=languages)
self.tweepy_stream_instance.sample.assert_called_once_with(is_async=True, languages=languages)


def test_start_stream_with_terms(self):
Expand All @@ -107,7 +107,7 @@ def test_start_stream_with_terms(self):
timeout=90,
retry_count=self.retry_count)
# Should start the filter with the terms
self.tweepy_stream_instance.filter.assert_called_once_with(track=self.term_list, async=True, languages=None)
self.tweepy_stream_instance.filter.assert_called_once_with(track=self.term_list, is_async=True, languages=None)


def test_stop_stream_not_started(self):
Expand Down
4 changes: 2 additions & 2 deletions twitter_monitor/stream.py
Expand Up @@ -114,10 +114,10 @@ def start_stream(self):
logger.info(" %s", repr(tracking_terms))

# Launch it in a new thread
self.stream.filter(track=tracking_terms, async=True, languages=self.languages)
self.stream.filter(track=tracking_terms, is_async=True, languages=self.languages)
else:
logger.info("Starting new unfiltered stream")
self.stream.sample(async=True, languages=self.languages)
self.stream.sample(is_async=True, languages=self.languages)

def stop_stream(self):
"""
Expand Down

0 comments on commit dc9846b

Please sign in to comment.