JaredLGillespie / proxyscrape

Python library for retrieving free proxies (HTTP, HTTPS, SOCKS4, SOCKS5).
MIT License
244 stars 55 forks source link

Fix intermediate failures with Python 2.7 #7

Closed JaredLGillespie closed 5 years ago

JaredLGillespie commented 5 years ago

Specific tests occassionally fail with Python 2.7. Rerunning the tests has a chance of success. Other versions seem to work properly.

Sample failed test:

======================================================================
ERROR: test_add_resource_type_multiple_resources (tests.test_scrapers.TestResource)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/JaredLGillespie/proxyscrape/tests/test_scrapers.py", line 647, in test_add_resource_type_multiple_resources
    add_resource_type('my-resource-type', ('us-proxy', 'uk-proxy'))
  File "/home/travis/build/JaredLGillespie/proxyscrape/proxyscrape/scrapers.py", line 378, in add_resource_type
    '{} is already defined as a resource type'.format(name))
ResourceTypeAlreadyDefinedError: my-resource-type is already defined as a resource type
======================================================================
FAIL: test_add_resource_type_exception_if_duplicate_lock_check (tests.test_scrapers.TestResource)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/JaredLGillespie/proxyscrape/tests/test_scrapers.py", line 635, in test_add_resource_type_exception_if_duplicate_lock_check
    add_resource_type('my-resource-type')
AssertionError: ResourceTypeAlreadyDefinedError not raised