Skip to content

Make gen_tests show up in VSCode test discovery#6424

Merged
jrbourbeau merged 1 commit intodask:mainfrom
gjoseph92:gen-test-functools-wrap
May 23, 2022
Merged

Make gen_tests show up in VSCode test discovery#6424
jrbourbeau merged 1 commit intodask:mainfrom
gjoseph92:gen-test-functools-wrap

Conversation

@gjoseph92
Copy link
Copy Markdown
Collaborator

Not entirely sure why, but @functools.wraps on the test function makes them show up. This is convenient when VSCode users want to debug a @gen_test test.

  • Passes pre-commit run --all-files

Not entirely sure why, but `@functools.wraps` on the test function makes them show up. This is convenient when VSCode users want to debug a `@gen_test` test.
@gjoseph92 gjoseph92 requested a review from jrbourbeau May 23, 2022 19:21
@github-actions
Copy link
Copy Markdown
Contributor

Unit Test Results

       15 files  ±0         15 suites  ±0   6h 50m 45s ⏱️ - 16m 29s
  2 808 tests ±0    2 726 ✔️ ±0    80 💤 ±0  2 ±0 
20 818 runs  ±0  19 889 ✔️ +2  927 💤  - 2  2 ±0 

For more details on these failures, see this check.

Results for commit a135579. ± Comparison against base commit 00a6445.

Copy link
Copy Markdown
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me -- thanks @gjoseph92

Noting that tests failures here are unrelated

@jrbourbeau
Copy link
Copy Markdown
Member

jrbourbeau commented May 23, 2022

This is pretty subtle -- is it something we could easily add a test for?

EDIT: Merging for now as this change is harmless (famous last words) and improves the VS Code dev experience. Feel free to push up a test in a follow-up PR is you've got the bandwidth

@jrbourbeau jrbourbeau merged commit 7665eaa into dask:main May 23, 2022
@graingert
Copy link
Copy Markdown
Member

graingert commented May 24, 2022

fyi this means that gen_test now supports marks either side of the @gen_test() decorator:

@pytest.mark.example
@gen_test()
@pytest.mark.example
def test_example():
    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants