Skip to main content

A simple plugin to use with pytest

Project description

pytest-inline is a plugin for pytest that writes inline tests.

Installation and usage

Use pip install pytest-inline to install our Python pytest-plugin

Use pytest . to run all inline tests in working directory

Use pytest {filename} to run all inline tests in a Python file

API

Declaration an inline test

  • Here(test_name, parameterized, repeated, tag, disabled, timeout):
    1. test_name is a string that represents the name of the test. The default value is the file name + line number of the test statement.

    2. parameterized is a boolean value that indicates whether the test is parameterized. The default value is false.

    3. repeated is an integer that indicates how many times the test is repeated. The default value is 1.

    4. tag is a string that represents the tag of the test. The default value is an empty string.

    5. disabled is a boolean value that indicates whether the test is disabled. The default value is false.

    6. timeout is an integer that represents the timeout of the test. The default value is -1.

Provide test inputs

  • given(variable, value):

    assign the value to the variable.

Specify test oracles

  • check_eq(actual_value, expected_value):

    check if the actual value is equal to the expected value.

  • check_neq(actual_value, expected_value):

    check if the actual value is not equal to the expected value.

  • check_true(expr):

    check if the boolean expression is true.

  • check_false(expr):

    check if the boolean expression is false.

  • check_none(variable):

    check if the variable is none.

  • check_not_none(variable):

    check if the variable is not none.

  • check_same(actual_value, expected_value):

    check if the actual value and the expected value refer to the same object.

  • check_not_same(actual_value, expected_value):

    check if the actual value and the expected value refer to different objects.

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-inline-1.0.0.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

pytest_inline-1.0.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file pytest-inline-1.0.0.tar.gz.

File metadata

  • Download URL: pytest-inline-1.0.0.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pytest-inline-1.0.0.tar.gz
Algorithm Hash digest
SHA256 01e5be0619176afbeba156b12a10f9b07112d0379feb1b3b093ff7c1427d247d
MD5 31c75b074db94785363e576bcc043584
BLAKE2b-256 8eeb87c03ab9a56645437a989ee4b461a318d090478a7dfca752247d58a93e5e

See more details on using hashes here.

File details

Details for the file pytest_inline-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_inline-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pytest_inline-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 076901f6bf0bb5a7d32919b119b52dea1c4106f5bcec4e38fd26256b5006bfc7
MD5 25a324c68fc7a0b9bc89c842b077de57
BLAKE2b-256 26a02ce358205f12760cb0b32a9133b17c3b0d514af94d1d140ef450363a958b

See more details on using hashes here.

Supported by

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