Skip to content

Commit

Permalink
add pause between tests (avoid IA throttling making CI fail?)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulbot committed Jan 22, 2024
1 parent 3c2496c commit 05eb848
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mcmetadata/test/test_extract.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest
import datetime as dt
import time
import pytest

import mcmetadata
from .. import extract
Expand All @@ -11,6 +12,11 @@

class TestExtract(unittest.TestCase):

@pytest.fixture(autouse=True)
def slow_down_tests(self):
yield
time.sleep(0.5)

def setUp(self) -> None:
webpages.DEFAULT_TIMEOUT_SECS = 30 # try to avoid timeout errors

Expand Down
7 changes: 7 additions & 0 deletions mcmetadata/test/test_webpages.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import unittest
import requests
import pytest
import time

from .. import webpages


class TestFetch(unittest.TestCase):

@pytest.fixture(autouse=True)
def slow_down_tests(self):
yield
time.sleep(0.5)

def test_regular_fetch(self):
url = "https://web.archive.org/web/https://bostonglobe.com"
html, response = webpages.fetch(url)
Expand Down

0 comments on commit 05eb848

Please sign in to comment.