Skip to content

Commit e00d0eb

Browse files
Merge pull request #456 from scholarly-python-package/develop
Hotfix for free-proxy breakage
2 parents 970d225 + 5efed39 commit e00d0eb

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ beautifulsoup4
33
bibtexparser
44
deprecated
55
fake_useragent
6-
free-proxy
6+
free-proxy<1.1.0
77
python-dotenv
88
requests[socks]
99
selenium

test_module.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,6 @@ def check_citedby_1k(self, pub):
818818
self.assertEqual(len(citation_list), original_citation_count)
819819
return citation_list
820820

821-
@unittest.skipIf(os.getenv("CONNECTION_METHOD") in {None, "none", "freeproxy"}, reason="No robust proxy setup")
822821
def test_citedby_1k_citations(self):
823822
"""Test that scholarly can fetch 1000+ citations from an author
824823
"""
@@ -832,7 +831,6 @@ def test_citedby_1k_citations(self):
832831
for year, count in pub["cites_per_year"].items():
833832
self.assertEqual(yearwise_counter.get(str(year), 0), count)
834833

835-
@unittest.skipIf(os.getenv("CONNECTION_METHOD") in {None, "none", "freeproxy"}, reason="No robust proxy setup")
836834
def test_citedby_1k_scholar(self):
837835
"""Test that scholarly can fetch 1000+ citations from a pub search.
838836
"""
@@ -841,6 +839,17 @@ def test_citedby_1k_scholar(self):
841839
pub = next(pubs)
842840
self.check_citedby_1k(pub)
843841

842+
def test_citedby(self):
843+
"""Test that we can search citations of a paper from author's profile.
844+
"""
845+
# Retrieve the author's data, fill-in, and print
846+
search_query = scholarly.search_author('Steven A Cholewiak')
847+
author = scholarly.fill(next(search_query))
848+
pub = scholarly.fill(author['publications'][0])
849+
850+
# Which papers cited that publication?
851+
top10_citations = [citation for num, citation in enumerate(scholarly.citedby(pub)) if num<10]
852+
self.assertEqual(len(top10_citations), 10)
844853

845854
if __name__ == '__main__':
846855
unittest.main()

0 commit comments

Comments
 (0)