Git Product home page Git Product logo

pytest-durations's Introduction

Introduction

A pytest plugin to measure fixture and test durations.

In order to get the pure test setup/teardown durations, plugin subtracts time taken by fixtures which scope is larger than "function".

Installation

$ pip install pytest-durations

Example or report

============================= fixture duration top =============================
total          name                                     num avg            min            max           
0:00:00.063821                            fake_reporter   4 0:00:00.015300 0:00:00.014831 0:00:00.018389
0:00:00.068513                              grand total  22 0:00:00.000117 0:00:00.000110 0:00:00.000132
============================ test call duration top ============================
total          name                                     num avg            min            max           
0:00:00.527693                 test_plugin_with_options   4 0:00:00.041085 0:00:00.040256 0:00:00.405267
0:00:00.041535                      test_plugin_disable   1 0:00:00.041535 0:00:00.041535 0:00:00.041535
0:00:00.018607            test_get_current_ticks_frozen   1 0:00:00.018607 0:00:00.018607 0:00:00.018607
0:00:00.590297                              grand total  10 0:00:00.000706 0:00:00.000706 0:00:00.000706
=========================== test setup duration top ============================
total          name                                     num avg            min            max           
0:00:00.018670                 test_report_measurements   1 0:00:00.018670 0:00:00.018670 0:00:00.018670
0:00:00.015979 test_report_measurements_with_rows_limit   1 0:00:00.015979 0:00:00.015979 0:00:00.015979
0:00:00.015100 test_report_measurements_with_time_limit   1 0:00:00.015100 0:00:00.015100 0:00:00.015100
0:00:00.015079   test_report_measurements_empty_results   1 0:00:00.015079 0:00:00.015079 0:00:00.015079
0:00:00.005076                 test_plugin_with_options   4 0:00:00.001138 0:00:00.001030 0:00:00.001770
0:00:00.071377                              grand total  10 0:00:00.015079 0:00:00.015079 0:00:00.015079
========================== test teardown duration top ==========================
total          name                                     num avg            min            max           
0:00:00.001990                              grand total  10 0:00:00.000128 0:00:00.000128 0:00:00.000128
============================== 10 passed in 0.71s ==============================

Development

Project uses poetry for dependencies management, pytest for testing and pre-commit for coding standard checks.

$ pip install poetry
$ poetry install
$ pre-commit install
$ pytest tests

Change Log

1.2.0 (Apr 22, 2022)

  • Use same width for all reports (#6)
  • Improve test coverage (#7)
  • Continuous delivery GitHub workflow

1.1.0 (Mar 7, 2022)

  • Do not interoperate with xdist if it is disabled or absent

1.0.1 (Feb 14, 2022)

  • Grand total row shows real min/max values instead of averages

1.0.0 (Feb 14, 2022)

  • First Release

pytest-durations's People

Contributors

blake-r avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.