Skip to content

Commit 890a19a

Browse files
authored
Merge pull request #311 from scholarly-python-package/develop
v1.2.2a
2 parents 46a5cbc + f2abe1c commit 890a19a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test_module.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ def setUp(self):
4545
elif self.connection_method == "freeproxy":
4646
proxy_generator.FreeProxies()
4747
scholarly.use_proxy(proxy_generator)
48+
elif self.connection_method == "scraperapi":
49+
proxy_generator.ScraperAPI(os.getenv('SCRAPER_API_KEY'))
50+
scholarly.use_proxy(proxy_generator)
4851
else:
49-
scholarly.use_proxy(None)
52+
scholarly.use_proxy(None)
5053

5154
def test_tor_launch_own_process(self):
5255
"""
@@ -228,13 +231,7 @@ def test_extract_author_id_list(self):
228231
author_id_list = pub_parser._get_author_id_list(author_html_partial)
229232
self.assertTrue(author_id_list[3] == 'TEndP-sAAAAJ')
230233

231-
def test_ScraperAPI(self):
232-
proxy_generator = ProxyGenerator()
233-
proxy_generator.ScraperAPI(os.getenv('SCRAPER_API_KEY'))
234-
scholarly.set_timeout(60)
235234

236-
## Uses another method to test that proxy is working.
237-
self.test_search_keyword()
238235

239236

240237
if __name__ == '__main__':

0 commit comments

Comments
 (0)