Skip to content

Conversation

whitneywhtsang
Copy link
Contributor

Skip executing tests marked with pytest.mark.xfail to save time.

@anmyachev
Copy link
Contributor

According to docs https://docs.pytest.org/en/stable/reference/reference.html#pytest.xfail: "No other code is executed after using xfail() (it is implemented internally by raising an exception)."

@whitneywhtsang whitneywhtsang marked this pull request as draft September 22, 2025 13:03
@whitneywhtsang
Copy link
Contributor Author

According to docs https://docs.pytest.org/en/stable/reference/reference.html#pytest.xfail: "No other code is executed after using xfail() (it is implemented internally by raising an exception)."

pytest.xfail and pytest.mark.xfail seem to behave differently.

@anmyachev
Copy link
Contributor

How will this affect the pass rate?

@whitneywhtsang
Copy link
Contributor Author

How will this affect the pass rate?

It should have no impact to pass rate, as xfail tests are not considered into pass rate calculation.

@anmyachev
Copy link
Contributor

It should have no impact to pass rate, as xfail tests are not considered into pass rate calculation.

Don't they count towards the total number of tests?

@whitneywhtsang
Copy link
Contributor Author

It should have no impact to pass rate, as xfail tests are not considered into pass rate calculation.

Don't they count towards the total number of tests?

Yes, but pass rate is calculated as pass / (pass + skip).

@whitneywhtsang whitneywhtsang changed the title [SCRIPTS] Do not run pytest.mark.xfail [TEST] Do not run pytest.mark.xfail Sep 25, 2025
Signed-off-by: Whitney Tsang <whitney.tsang@intel.com>
@whitneywhtsang whitneywhtsang marked this pull request as ready for review September 25, 2025 01:58
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.

2 participants