Skip to content

Commit

Permalink
test: replace pytest-freezegun with freezgun
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinaa committed Nov 14, 2022
1 parent e8d2001 commit a13fe46
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 23 deletions.
25 changes: 5 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ types-PyYAML = "^6.0.11"
types-requests = "^2.28.10"
types-geoip2 = "^3.0.0"
scalene = "^1.5.13"
pytest-freezegun = "^0.4.2"
freezegun = "^1.2.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/api/v1/providers/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import pytest
from fastapi.testclient import TestClient
from freezegun import freeze_time
from pytest import LogCaptureFixture

from merino.providers import BaseProvider
Expand Down Expand Up @@ -85,7 +86,7 @@ def test_providers(
assert response.json() == expected_response


@pytest.mark.freeze_time("1998-03-31")
@freeze_time("1998-03-31")
@pytest.mark.parametrize("providers", [{}])
def test_providers_request_logs(
caplog: LogCaptureFixture,
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/api/v1/suggest/test_suggest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import pytest
from fastapi.testclient import TestClient
from freezegun import freeze_time
from pytest import LogCaptureFixture
from pytest_mock import MockerFixture

Expand Down Expand Up @@ -81,7 +82,7 @@ def test_client_variants(client: TestClient) -> None:
assert result["client_variants"] == ["foo", "bar"]


@pytest.mark.freeze_time("1998-03-31")
@freeze_time("1998-03-31")
def test_suggest_request_logs(
mocker: MockerFixture,
caplog: LogCaptureFixture,
Expand Down

0 comments on commit a13fe46

Please sign in to comment.