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.3.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.3-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pytest_fly-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7892c771efceaef90c9539f8c37bf6b28915a8e18918046af4a16677552e8e27
MD5 ec9c6aac15db0fe3f540d08e6e79bc83
BLAKE2b-256 949b10fa7bb73f8d6109ae90db1b03c7abf1ec9373e894388cc24a4e00fef701

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_fly-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 40.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.2 cpython/3.14.2 HTTPX/0.28.1

File hashes

Hashes for pytest_fly-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c205b07a67359df75ad37755127fd0dfdd726089fc72d6a7e6cb0399b2d6d183
MD5 eac15c1b3c574405019b47c26c2aaaf1
BLAKE2b-256 a1e2df4f4abf29a3fd29c005f155aef1f0faf21345ed1fbfb0cc8280c72981c9

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