Skip to content

Conversation

@gibiw
Copy link
Contributor

@gibiw gibiw commented Jan 16, 2025

Resolved the following issues:
1. Custom statuses did not work when using pytest.xfail within the test body. #321
2. The test status was displayed incorrectly when using the skipif mark. #320

This pull request includes several changes to the qase-pytest plugin, focusing on version updates, bug fixes, and improvements to the handling of test statuses and logging.

Version Update:

Bug Fixes:

  • qase-pytest/changelog.md: Documented fixes for issues with pytest.xfail and the skipif mark, where custom statuses did not work within the test body and the status was incorrect, respectively.

Improvements to Test Status Handling:

  • qase-pytest/src/qase/pytest/plugin.py: Refactored the pytest_runtest_makereport method to improve the handling of xfail statuses and ensure correct status assignment for skipped and failed tests. This includes the addition of a helper method handle_xfail_status to determine the correct status based on the xfail mark.
  • qase-pytest/src/qase/pytest/plugin.py: Modified the __is_use_xfail_mark method to check for the wasxfail attribute instead of the xfail keyword in the report.

Logging Enhancements:

  • qase-pytest/src/qase/pytest/plugin.py: Improved log attachment handling by consolidating the logic into a new attach_logs method and ensuring logs are attached only when the test call phase is complete.

Resolved the following issues:
	1.	Custom statuses did not work when using `pytest.xfail` within the test body. #321
	2.	The test status was displayed incorrectly when using the `skipif` mark. #320
@gibiw gibiw merged commit a923abd into main Jan 16, 2025
36 checks passed
@gibiw gibiw deleted the fix/status branch January 16, 2025 09:08
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