datalad / datalad-deprecated

DataLad extension for functionality that has been phased out of the core package
Other
0 stars 3 forks source link

test_publish_recursive might need fixing for result assessment helpers fix #69

Closed yarikoptic closed 1 year ago

yarikoptic commented 1 year ago

In https://github.com/datalad/datalad/pull/7002 we got this test to fail

____________________________ test_publish_recursive ____________________________

pristine_origin = '/tmp/datalad_temp_testrepo_ryu3tayv'
origin_path = '/tmp/datalad_temp_test_publish_recursiveddf99i6_'
src_path = '/tmp/datalad_temp_test_publish_recursive26u_j819'
dst_path = '/tmp/datalad_temp_test_publish_recursivepvohroa2'
sub1_pub = '/tmp/datalad_temp_test_publish_recursive7_u91fuh'
...
        # Don't fail when a string is passed as `dataset` and since="".
>       assert_status("notneeded", publish(since='^', dataset=source.path))

/opt/hostedtoolcache/Python/3.7.14/x64/lib/python3.7/site-packages/datalad_deprecated/tests/test_publish.py:457: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

label = ['notneeded'], results = []

    def assert_status(label, results):
        """Verify that each status dict in the results has a given status label

        `label` can be a sequence, in which case status must be one of the items
        in this sequence.
        """
        label = ensure_list(label)
        results = ensure_result_list(results)
        if len(results) == 0:
            # If there are no results, an assertion about all results must fail.
>           raise AssertionError("No results retrieved")
E           AssertionError: No results retrieved

../datalad/tests/utils_pytest.py:1482: AssertionError

attn @bpoldrack which might know the fix right away ;-)

bpoldrack commented 1 year ago

I don't know the fix yet. publish does indeed return an empty list. So https://github.com/datalad/datalad/pull/7002 made the failure apparent, but that call never returned the asserted result. In this case it doesn't seem to be about simply having the wrong result_xfm.

yarikoptic commented 1 year ago

given that it was "notneeded" to be expected -- I would not sweat too much about not seeing that one returned, will send a PR shortly ;)

github-actions[bot] commented 1 year ago

:rocket: Issue was released in 0.2.4 :rocket: