Skip to content

Commit a1aa1bc

Browse files
committed
Fix slow unit test
The test was triggering an intentional delay in a function, resulting in this test causing a signficant increase in the time required to run the unit tests. The solution was to simply fake time.sleep() so it no longer causes a delay.
1 parent 66f2d53 commit a1aa1bc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

reportsizedeltas/tests/test_reportsizedeltas.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,9 @@ def test_handle_rate_limiting():
832832
report_size_deltas.handle_rate_limiting()
833833

834834

835-
@pytest.mark.slow(reason="Causes a delay")
836-
def test_determine_urlopen_retry_true():
835+
def test_determine_urlopen_retry_true(mocker):
836+
mocker.patch("time.sleep", autospec=True)
837+
837838
assert reportsizedeltas.determine_urlopen_retry(
838839
exception=urllib.error.HTTPError(None, 502, "Bad Gateway", None, None))
839840

0 commit comments

Comments
 (0)