diff --git a/singer_sdk/contrib/filesystem/tap.py b/singer_sdk/contrib/filesystem/tap.py index 8584a6ca8..c882385a3 100644 --- a/singer_sdk/contrib/filesystem/tap.py +++ b/singer_sdk/contrib/filesystem/tap.py @@ -188,9 +188,10 @@ def discover_streams(self) -> list: tap=self, name=self.config["stream_name"], filepaths=[ - os.path.join(path, member["name"]) # noqa: PTH118 + member["name"] for member in self.fs.listdir(path) - if member["name"].endswith(self.valid_extensions) + if member["type"] == "file" + and member["name"].endswith(self.valid_extensions) ], filesystem=self.fs, ) diff --git a/singer_sdk/testing/templates.py b/singer_sdk/testing/templates.py index 8a21f639c..4fa708ab0 100644 --- a/singer_sdk/testing/templates.py +++ b/singer_sdk/testing/templates.py @@ -104,7 +104,7 @@ def run( ValueError: if Test instance does not have `name` and `type` properties. """ if not self.name or not self.plugin_type: - msg = "Test must have 'name' and 'type' properties." + msg = "Test must have 'name' and 'plugin_type' properties." raise ValueError(msg) self.config = config diff --git a/tests/samples/test_tap_csv.py b/tests/samples/test_tap_csv.py index cb16e0e0e..8d735c3f2 100644 --- a/tests/samples/test_tap_csv.py +++ b/tests/samples/test_tap_csv.py @@ -1,11 +1,15 @@ from __future__ import annotations import datetime +import typing as t import pytest from samples.sample_tap_csv.sample_tap_csv import SampleTapCSV -from singer_sdk.testing import SuiteConfig, get_tap_test_class +from singer_sdk.testing import SuiteConfig, TapTestRunner, get_tap_test_class + +if t.TYPE_CHECKING: + from samples.sample_tap_csv.client import CSVStream _TestCSVMerge = get_tap_test_class( tap_class=SampleTapCSV, @@ -76,10 +80,12 @@ class TestCSVOneStreamPerFile(_TestCSVOneStreamPerFile): class TestCSVOneStreamPerFileIncremental(_TestCSVOneStreamPerFileIncremental): - @pytest.mark.xfail(reason="No records are extracted", strict=True) - def test_tap_stream_transformed_catalog_schema_matches_record(self, stream: str): - super().test_tap_stream_transformed_catalog_schema_matches_record(stream) - - @pytest.mark.xfail(reason="No records are extracted", strict=True) - def test_tap_stream_returns_record(self, stream: str): - super().test_tap_stream_returns_record(stream) + def test_tap_stream_returns_record( + self, + config: SuiteConfig, + resource: t.Any, + runner: TapTestRunner, + stream: CSVStream, + ): + with pytest.warns(UserWarning): + super().test_tap_stream_returns_record(config, resource, runner, stream)