Skip to content

Commit

Permalink
add test retries
Browse files Browse the repository at this point in the history
  • Loading branch information
mazen-r committed Sep 23, 2024
1 parent aca5eac commit c2f5c9b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions nordstorm-scraper/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ruff = "^0.0.269"
cerberus = "^1.3.4"
pytest = "^7.3.1"
pytest-asyncio = "^0.21.0"
pytest-rerunfailures = "^14.0"

[build-system]
requires = ["poetry-core"]
Expand Down
2 changes: 2 additions & 0 deletions nordstorm-scraper/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def validate_or_fail(item, validator):


@pytest.mark.asyncio
@pytest.mark.flaky(reruns=3, reruns_delay=30)
async def test_product_scraping():
products_data = await nordstorm.scrape_products(
urls=[
Expand All @@ -116,6 +117,7 @@ async def test_product_scraping():


@pytest.mark.asyncio
@pytest.mark.flaky(reruns=3, reruns_delay=30)
async def test_search_scraping():
search_data = await nordstorm.scrape_search(
url="https://www.nordstrom.com/sr?origin=keywordsearch&keyword=indigo", max_pages=3
Expand Down
1 change: 1 addition & 0 deletions realtorcom-scraper/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ruff = "^0.0.269"
cerberus = "^1.3.4"
pytest = "^7.3.1"
pytest-asyncio = "^0.21.0"
pytest-rerunfailures = "^14.0"

[build-system]
requires = ["poetry-core"]
Expand Down
3 changes: 3 additions & 0 deletions realtorcom-scraper/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def validate_or_fail(item, validator):


@pytest.mark.asyncio
@pytest.mark.flaky(reruns=3, reruns_delay=30)
async def test_property_scraping():
url = "https://www.realtor.com/realestateandhomes-detail/12355-Attlee-Dr_Houston_TX_77077_M70330-35605"
result = await realtorcom.scrape_property(url)
Expand Down Expand Up @@ -57,6 +58,7 @@ async def test_property_scraping():


@pytest.mark.asyncio
@pytest.mark.flaky(reruns=3, reruns_delay=30)
async def test_search_scraping():
result = await realtorcom.scrape_search("CA", "San-Francisco", max_pages=2)
schema = {
Expand All @@ -71,6 +73,7 @@ async def test_search_scraping():
validate_or_fail(item, validator)

@pytest.mark.asyncio
@pytest.mark.flaky(reruns=3, reruns_delay=30)
async def test_feed_scraping():
url = "https://www.realtor.com/realestateandhomes-detail/sitemap-rss-price/rss-price-ca.xml"
result_feed = await realtorcom.scrape_feed(url)
Expand Down

0 comments on commit c2f5c9b

Please sign in to comment.