-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When steps are present, we now offer
session_results_df_pivoted
and…
… `module_results_df_pivoted` default fixtures, to align with `pytest-harvest` >= 1.1 default fixtures `session_results_df` and `module_results_df`. Fixes #23 Updated tests accordingly.
- Loading branch information
Showing
4 changed files
with
123 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pytest | ||
|
||
from pytest_steps import pivot_steps_on_df, handle_steps_in_results_df | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def session_results_df_steps_pivoted(request, session_results_df): | ||
""" | ||
A pivoted version of fixture `session_results_df` from pytest_harvest. | ||
In this version, there is one row per test with the results from all steps in columns. | ||
""" | ||
# Handle the steps | ||
session_results_df = handle_steps_in_results_df(session_results_df, keep_orig_id=False) | ||
|
||
# Pivot | ||
return pivot_steps_on_df(session_results_df, pytest_session=request.session) | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def module_results_df_steps_pivoted(request, module_results_df): | ||
""" | ||
A pivoted version of fixture `module_results_df` from pytest_harvest. | ||
In this version, there is one row per test with the results from all steps in columns. | ||
""" | ||
# Handle the steps | ||
module_results_df = handle_steps_in_results_df(module_results_df, keep_orig_id=False) | ||
|
||
# Pivot | ||
return pivot_steps_on_df(module_results_df, pytest_session=request.session) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.