python-pytest-harvest

Store data created during your `pytest` tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes.

BSD-3-CLAUSE License

Downloads
86.8K
Stars
63
Committers
5

Bot releases are hidden (Show)

python-pytest-harvest - 1.2.1 - Minor: new low-level API

Published by smarie almost 6 years ago

New method get_all_pytest_fixture_names to list all fixture names used by items in a session.

See documentation page for details.

python-pytest-harvest - 1.2.0 - Added column in default dataframe synthesis fixtures

Published by smarie almost 6 years ago

Fixtures module_results_df and session_results_df now contains the 'pytest_obj' column.

See documentation page for details.

python-pytest-harvest - 1.1.0 - New default fixtures + fixture parameter names fix

Published by smarie almost 6 years ago

Created 6 fixtures registered by default by the plugin. Fixed #14:

  • fixture_store in an OrderedDict that can be used as a fixture store, typically in @saved_fixture.
  • results_bag is a ResultsBag-typed results bag.
  • session_results_dct and module_results_dct return a synthesis dictionary for all tests completed "so far", respectively in the session or module. They include
    contents from the default fixture_store, including results_bag.
  • session_results_df and module_results_df are the dataframe equivalents of session_results_dct and module_results_dct

The documentation has been updated so that users can get started more quickly by leveraging them.

In addition:

  • get_session_synthesis_dct can now take both a session or a request input. If a request is provided, the status of current item will be marked as 'pending', while not started items will be marked as 'unknown'.
  • fixed bug in get_session_synthesis_dct: fixture parameters and saved fixtures where overriding each other in the final dict in flatten=True mode. Now fixture parameters appear as '<fixture_name>_param'. Fixed #15.
  • @saved_fixture can now be used without arguments. By default it will store fixtures in the default session-scoped 'fixture_store' fixture.
  • HARVEST_PREFIX moved to common.py and is now exported at package level.

See documentation page for details.

python-pytest-harvest - 1.0.1 Ordering bug fix

Published by smarie almost 6 years ago

Fixed pytest ordering issue, by relying on place_as. See #18

See documentation page for details.

python-pytest-harvest - 1.0.0 - new methods for pytest session analysis

Published by smarie almost 6 years ago

New methods are provided to analyse pytest session results:

  • filter_session_items(session, filter=None) is the filtering method used behind several functions in this package - it can be used independently. pytest_item_matches_filter is the inner method used to test if a single item matches the filter.
  • get_all_pytest_param_names(session, filter=None, filter_incomplete=False) lists all unique parameter names used in pytest session items, with optional filtering capabilities. Fixes #12
  • is_pytest_incomplete(item), get_pytest_status(item), get_pytest_param_names(item) and get_pytest_params(item) allow users to analyse a specific item.

See documentation page for details.

python-pytest-harvest - 0.9.0 - `get_session_synthesis_dct`: filter bugfix + test id formatter

Published by smarie almost 6 years ago

  • get_session_synthesis_dct:

    • filter now correctly handles class methods. Fixed #11
    • new test_id_format option to process test ids. Fixed #9

See documentation page for details.

python-pytest-harvest - 0.8.0 - Documentation + better filters in `get_session_synthesis_dct`

Published by smarie almost 6 years ago

  • Documentation: added a section about creating the synthesis table from inside a test function (fixes #4). Also, added a link to a complete example file.

  • get_session_synthesis_dct:

    • filter argument can now contain module names (fixed #7). Also now the function filters out incomplete tests by default. A new filter_incomplete argument can be used to display them again (fixed #8).
    • does not output the stage by stage details (setup/call/teardown) anymore by default, but a new option status_details allows users to enable them. Fixes #5
    • has also 2 new options durations_in_ms and pytest_prefix to better control the output.
  • Results bags do not measure execution time anymore since this is much less accurate than pytest duration. Fixes #6

See documentation page for details.

python-pytest-harvest - 0.6.0 - `get_session_synthesis_dct` improvements

Published by smarie almost 6 years ago

  • get_session_synthesis_dct now has a test object filter, a flatten option, and and can now take optional storage objects as input to create a fully merged dictionary. See help(get_session_synthesis_dct) for details. Fixes #3

See documentation page for details.

python-pytest-harvest - First public release

Published by smarie almost 6 years ago

First version validated against a true data science benchmark

  • get_session_synthesis_dct method to collect various test information already available
  • @saved_fixture decorator supports both a variable or a fixture for the storage
  • create_results_bag_fixture to create results bags
  • Documentation

Don't hesitate to provide feedback !