Skip to main content

pytest runner and observer

Project description

pytest-fly

pytest-fly aides the development, debug, and execution of complex code bases and test suites.

Features of pytest-fly

  • Real-time monitor test execution in a GUI. Displays what tests are currently running, what tests have completed, and what tests have failed. A time-based graph provides a visual representation of test progress.
  • Resumable test execution. Only runs tests that have not yet been run or have failed.
  • Graceful interruption of test execution. Allows the user to stop the test suite and then resume where it left off.
  • Checks the code under test and restarts the test run from scratch if the code has changed.
  • Optimally run tests in parallel. Monitors system resources and dynamically adjusts the number of parallel tests accordingly.
  • Provides an estimate of the time remaining for the test suite to complete. Uses prior test run times to estimate the time remaining.
  • Optional code coverage. Code coverage can also run tests in parallel.
  • Run specific tests as a singleton via pytest markers (pytest.marker.singleton).

Installation

You can install pytest-fly via pip from PyPI:

    pip install pytest-fly

Parallelism

By default, pytest-fly executes modules (.py files) in parallel.

Functions inside a module are executed serially with respect to each other. No parallelism is performed for functions inside a module. For example, if a set of tests use a shared resource that does not support concurrent access, putting those tests in the same module ensures the tests do not conflict.

Functions can optionally be run as a singleton via the pytest.mark.singleton marker. No other tests are run at the same time singleton functions are run.

In pytest terms, each module will be run as a separate session. Therefore, a pytest fixture with a session scope will actually be executed multiple times, once for each modulee.

Note that test concurrency in pytest-fly is different from pytest-xdist. group-by in pytest-xdist is analogous to putting the tests in the same module in pytest-fly.

Test Scheduling

pytest-fly attempts to order tests to make the best use of the test developer's time. The goal is for the more actionable and insightful information to appear earlier. In general, pytest-fly takes the following into account when scheduling tests:

  1. Failed tests are re-run first. This is beneficial when a test developer is fixing failed tests. Note that if a test is expected to fail, it should be temporarily marked as such to avoid spending time re-running a test that will merely fail.
  2. Tests with a higher coverage over time (i.e., lines/second) are run earlier. This way, if there is a problem in the code, it is more likely to be found earlier in the test run.
  3. Tests are scheduled for maximum parallelism. Long-running tests are started earlier to minimize overall runtime. Also, tests that consume large amounts of particular resources (e.g., memory, file system, etc.) tend to be paired with other tests that do not use as much of those resources.
  4. singleton tests are run last. This is to attempt to get higher coverage earlier in the test run.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_fly-0.1.5.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_fly-0.1.5-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

Details for the file pytest_fly-0.1.5.tar.gz.

File metadata

  • Download URL: pytest_fly-0.1.5.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.14.3 HTTPX/0.28.1

File hashes

Hashes for pytest_fly-0.1.5.tar.gz
Algorithm Hash digest
SHA256 499c3f15306700bcdb30664a55ddf7da3da3de2c53a249d73d58ef3cf63b3e72
MD5 797c7de46417a2f3ba859b18acfde500
BLAKE2b-256 4acb140fe87fd497680219d9d991a6376c5d515358a52e59be040886b87d009b

See more details on using hashes here.

File details

Details for the file pytest_fly-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pytest_fly-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 41.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.14.3 HTTPX/0.28.1

File hashes

Hashes for pytest_fly-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4ed3b1349279ce35466553b98b4b9f2f942938161ba43e45c63aa9fa412ae100
MD5 ce1dbfe0eda1cc3df367a70cfa7f5987
BLAKE2b-256 b783b53bc6f3e162ec4bfb0bdb7f18d07567bc2e1ec3c261d21d9ae3ae3153b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page