Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype pytest plugin for test discovery/execution. #19790

Closed
3 tasks done
karthiknadig opened this issue Sep 7, 2022 · 6 comments
Closed
3 tasks done

Prototype pytest plugin for test discovery/execution. #19790

karthiknadig opened this issue Sep 7, 2022 · 6 comments
Assignees
Labels
area-testing feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@karthiknadig
Copy link
Member

karthiknadig commented Sep 7, 2022

  • Ensure that any additional plugins that modify id like hypothesis are handled.
  • Ensure that pytest is be launched using pytest binary (pytest.exe or /bin/pytest) or as module (python -m pytest).
  • Ensure that result is printed to stdout if server is not available (this should help with debugging)

This implementation should be no different than any other pytest plugin, this way we don't interfere with how pytest detects tests, or id generation, test selection, or execution. While debugging tests this plugin will be added to the ignore list in the debug configuration.

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Sep 7, 2022
@karthiknadig karthiknadig added this to the September 2022 milestone Sep 7, 2022
@karthiknadig karthiknadig added feature-request Request for new features or functionality needs PR Ready to be worked on and removed triage-needed Needs assignment to the proper sub-team labels Sep 7, 2022
@eleanorjboyd eleanorjboyd modified the milestones: March 2023, April 2023 Mar 20, 2023
@karthiknadig karthiknadig modified the milestones: April 2023, May 2023 Apr 21, 2023
@eleanorjboyd eleanorjboyd modified the milestones: May 2023, June 2023 May 31, 2023
@eleanorjboyd
Copy link
Member

@karthiknadig can you confirm these second two bullet points are set with the current status of the rewrite? Additionally I will put it on the todo list to test with hypothesis

@karthiknadig
Copy link
Member Author

@eleanorjboyd yes. I just verified those.

@eleanorjboyd eleanorjboyd modified the milestones: June 2023, July 2023 Jun 26, 2023
@eleanorjboyd
Copy link
Member

eleanorjboyd commented Oct 23, 2023

just checked and the hypothesis plugin works with the new rewrite. steps to check:

  1. install hypothesis lib python -m pip install hypothesis
  2. discover and run tests with this test file and it works

file name: test_ex.py

from hypothesis import given, strategies as st


@given(st.integers(), st.integers())
def test_addition_is_commutative(x, y):
    assert x + y == y + x

@eleanorjboyd eleanorjboyd added the verification-needed Verification of issue is requested label Oct 23, 2023
@github-actions github-actions bot removed the needs PR Ready to be worked on label Oct 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2023
@andreamah
Copy link

I tried to get this to work, but the test seems to be running forever. Am I doing something wrong?
image

@rzhao271
Copy link

The test worked on my end, though I had to restart while setting up because I tried discovering the tests, only to realize I forgot to create an environment, so then I tried creating an environment, which put the editor in a condition where it kept failing to discover tests after. If I can repro such a setup, I'll file an issue for it.

@rzhao271 rzhao271 added the verified Verification succeeded label Nov 29, 2023
@eleanorjboyd
Copy link
Member

@andreamah, could you file a bug on this with logs?

@rzhao271, thank you definitely file a bug if you see it again. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants