Skip to content

Commit

Permalink
Switch to legacy tests setup to be able to mock requests
Browse files Browse the repository at this point in the history
  • Loading branch information
wadevries committed Sep 13, 2023
1 parent a36db9b commit 52f7ff4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 120 deletions.
127 changes: 13 additions & 114 deletions poetry.lock

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

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ requests = "^2.31.0"
[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
singer-sdk = { version="^0.31.1", extras = ["testing"] }
requests-mock = "^1.11.0"

[tool.mypy]
python_version = "3.9"
Expand Down
13 changes: 7 additions & 6 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import datetime

from singer_sdk.testing import get_tap_test_class
from singer_sdk.testing.legacy import get_standard_tap_tests

from tap_linear.tap import TapLinear

Expand All @@ -12,8 +12,9 @@
}


# Run standard built-in tap tests from the SDK:
TestTapLinear = get_tap_test_class(
tap_class=TapLinear,
config=SAMPLE_CONFIG,
)
def test_standard_tap_tests(requests_mock) -> None: # noqa: ANN001
"""Run standard built-in tap tests from the SDK."""
requests_mock.post("/graphql", json={"data": {"results": {"nodes": []}}})
tests = get_standard_tap_tests(TapLinear, config=SAMPLE_CONFIG)
for test in tests:
test()

0 comments on commit 52f7ff4

Please sign in to comment.