Skip to main content

A library for python for easy testing.

Project description

quicktests

A library for python for easy testing.

Example

Example 1: TestBase

from quicktests import print_report, TestBase


class Test(TestBase):
    def test_one_equals_one(self):
        assert 1 == 1, "One does not equal one"

    def test_one_equals_one_str(self):
        assert "One" == "One", "\"One\" does not equal \"One\""


if __name__ == '__main__':
    print_report(Test())

The code above provides the following information:

Ran 2 tests.
Running tests took 4.887580871582031e-05 seconds.
No failed tests.
No errors were found. Add more code to verify your code is working.

Example 2: MiniTest

from quicktests import print_report, MiniTest


if __name__ == '__main__':
    def complex_test():
        return False

    print_report(
        MiniTest(
            test_true=[
                lambda: True,
                "Returns True"
            ],
            test_false=[
                lambda: False,
                "Returns False"
            ],
            test_error=[
                lambda: 1 / 0,
                "This is wrong"
            ],
            test_complex=[
                complex_test,
                "This is complex"
            ],
            test_with_really_long_name=[
                lambda: False,
                "This is a long name",
            ]
        )
    )

The code above provides the following information:

Ran 5 tests.
Running tests took 4.076957702636719e-05 seconds.
4 failed tests:
1. test 'complex':               <class 'AssertionError'> -> This is complex
2. test 'error':                 <class 'ZeroDivisionError'> -> division by zero
3. test 'false':                 <class 'AssertionError'> -> Returns False
5. test 'with really long name': <class 'AssertionError'> -> This is a long name

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

quicktests-0.0.4.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

quicktests-0.0.4-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file quicktests-0.0.4.tar.gz.

File metadata

  • Download URL: quicktests-0.0.4.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9

File hashes

Hashes for quicktests-0.0.4.tar.gz
Algorithm Hash digest
SHA256 49e40555425a17c3288858311544e4e70e99c5d734e66d96e1be9741e374eaf3
MD5 05e1a68be1ddb0fb3cfb26000de8b287
BLAKE2b-256 553af4c4fc510d2a2381f16e319f872cd1c51babfe56e82e6b42bcdf50434c6e

See more details on using hashes here.

File details

Details for the file quicktests-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: quicktests-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9

File hashes

Hashes for quicktests-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ffbf787e87958e13b8ba8275d63db699df54953fac42d71cdf478b7ffaa07417
MD5 632054bf77a094054c3ada09d2e3b7c6
BLAKE2b-256 ea919130589c7933b2fd3c6973fcbeb1b231b70e31a546e9991adbe31886da84

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