When running the SDK standard built-in tap tests, ...
# singer-target-development
r
When running the SDK standard built-in tap tests, I'm getting this error:
Copy code
/home/reuben/Documents/taps/tap-msaccess/tests/test_core.py::TestTapMSAccess::test_tap_stream_transformed_catalog_schema_matches_record failed with error: Test failed with exception
file /home/reuben/.cache/pypoetry/virtualenvs/tap-msaccess-XilzlSH0-py3.8/lib/python3.8/site-packages/singer_sdk/testing/templates.py, line 173
      def run(  # type: ignore[override]
E       fixture 'stream' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, resource, runner, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.
/home/reuben/.cache/pypoetry/virtualenvs/tap-msaccess-XilzlSH0-py3.8/lib/python3.8/site-packages/singer_sdk/testing/templates.py:173
Anyone run into this issue before? I wonder if there is some condition that needs to be met by the tap that makes the
stream
fixture available internally... The tap is doing dynamic stream discovery if that helps narrow it down.
👀 1
✅ 1
Same problem for all the tests with errors:
e
Can you try the 0.35.0rc1 prerelease? This was a known nuisance because we had incorrectly defined our pytest plugin.
r
Sure, one second...
😀 1
Yeah, that seems to have fixed it - running tests this time reveals that some streams don't return any records, which is correct (probably why the fixture wasn't available in the previous SDK version).
Is there a way to flag those as expected failures? Or would it be best practice to not discover those streams?
e
In the current 0.34.1 you need to explicitly define the plugin: https://github.com/edgarrmondragon/tap-shortcut/blob/155d067bf4fd3e1a3469b91534bf36bff8a1debb/tests/conftest.py#L4 (annoyingly, this will conflict in 0.35.0 but it's gonna be more correct 😅 ) For the missing streams, you can ignore them: https://github.com/edgarrmondragon/tap-shortcut/blob/155d067bf4fd3e1a3469b91534bf36bff8a1debb/tests/test_core.py#L18
🙌 1
r
Should have read the docs! 😬 https://sdk.meltano.com/en/latest/testing.html#configuring-tests Thanks for the help @Edgar Ramírez (Arch.dev)!
np 1
New SDK version works great, thanks @Edgar Ramírez (Arch.dev)!
np 1
m
Seconded, thank you, had this exact issue last Friday and this thread fixed it for me - have since moved up to 0.35.0
🙌 1