Skip to main content

The purpose of Know It’s Ok is to make it as easy as possible to run your tests while you’re debugging your code. In particular, it’s main features are:

  1. It finds your tests from anywhere in your repository.

  2. It runs your tests with arguments tailored towards debugging.

  3. It only requires typing two letters: ok

Installation

Know It’s Ok is available from PyPI:

$ pip install know_its_ok

It’s only dependencies are pytest and pytest-cov, which should both be installed automatically.

Usage

You can run Know It’s Ok from anywhere in your package’s repository:

$ ok

You can also specify individual tests to run (by default they will all be run). You don’t need to specify the complete name of a test, any substring of a test will be understood. For example, if you have a test called test_foo.py, you can use this command to run it:

$ ok foo

You can also specify arguments that should be passed through to pytest (this won’t work if the argument to pytest also matches the name of one of your tests, but in practice this is never a problem):

$ ok --pdb

In order to discover your tests simply, Know It’s Ok is very opinionated about the organization of your code. In particular:

  1. Your code must be version controlled using git.

  2. Your tests must be stored in a directory called tests/, which itself must be located in the top level of your repository.

  3. Inside the tests/ directory, your tests must match the pattern: ??_test_*.py.

  4. Your tests must be written using the pytest framework.

  5. Your package must be located in a directory containing and __init__.py file.

If any of these expectations are not met, the code should raise an exception.

Metadata

Release files for know_its_ok 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for know_its_ok 0.5.0
File Size Uploaded
know_its_ok-0.5.0.tar.gz 14.8 kB Details

Release files / know_its_ok-0.5.0.tar.gz

Download URL know_its_ok-0.5.0.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2ab2ee078f61c93a8281458ba9b56cde0de03ea299201f0982f362e8045278cc
BLAKE2b-256 checksum
How to use checksums
0779ac1741c35e26432a589b49147b7778b37942e07201477289411eed4f4603
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.5.0 This release

1 release file

0.4.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page