Skip to main content

Simple engine for your test. No code, no noodles

Project description

Table test

This package wrote to use table tests in python. The best practice and very useful practice is test with simple-style structure. You don't write any code: for-loop, conditions, exceptions and other difficult constructions in tests. You describe your test as some cases:

  • Name
  • Description
  • Object (class or function)
  • Target value or exception
  • After and before middleware

Such kind of tests intend of standartization and getting rid of verbosity. You can find some examples into tests. More sophisticated examples you can find here

Installation

git clone https://github.com/Hedgehogues/table-tests
pip install -r requirements

Our recommendations

If you want to use our util, we recommend to use for single class for testing each function or method. You must inherit from the base class and build your own class:

from utils import BaseTestClass, SubTest
from example.c import MyClass


class MyTest(BaseTestClass):

    def setUp(self):
        self.tests = [
            SubTest(
                name="Test 1",
                description="This is accepted test for MyClass.plus method",
                object=MyClass(5),
                args={'b': 1},
                want=6,
            ),
        ]

    def test(self):
        for test in self.tests:
            self.apply_test(test, lambda obj, kwargs: obj.plus(**kwargs))
  • BaseTestClass - this is simple engine for process your tests.
  • SubTest - this is instance of your test

You're welcome! Enjoy it (=.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

table_test-0.4.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file table_test-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: table_test-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for table_test-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 633adab978cd747f7b433045e3472ff2395d86260ed76ebfed6008a51351e063
MD5 961c13f2b34a34b46373ef67821204da
BLAKE2b-256 bfd66cd56afa131d4bec023a63d802a6882f0d3547f9b321fea4184a1fc9848c

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