Skip to main content

It contains common elements for testing purposes...

Project description

core-tests


This project contains basic elements for testing purposes and the ability to run (via console commands) tests and code coverage (unittest-based). This way, we can stick to the DRY -- Don't Repeat Yourself principle and avoid code duplication in each python project where tests coverage and tests execution are expected...

How to Use

Install the package

pip install core-tests

Create entry-point

# manager.py

from click.core import CommandCollection
from core_tests.tests.runner import cli_tests

if __name__ == "__main__":
    cli = CommandCollection(sources=[cli_tests()])
    cli()

Shell commands

python manager.py run-tests --test-type unit
python manager.py run-tests --test-type integration
python manager.py run-tests --test-type "another folder that contains test cases under ./tests"
python manager.py run-tests --test-type functional --pattern "*.py"
python manager.py run-coverage

Execution Environment

Install libraries

pip install --upgrade pip 
pip install virtualenv

Create the Python Virtual Environment

virtualenv --python={{python-version}} .venv
virtualenv --python=python3.11 .venv

Activate the Virtual Environment

source .venv/bin/activate

Install required libraries

pip install .

Check tests and coverage...

python manager.py run-tests
python manager.py run-coverage

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

core_tests-1.1.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

core_tests-1.1.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file core_tests-1.1.3.tar.gz.

File metadata

  • Download URL: core_tests-1.1.3.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for core_tests-1.1.3.tar.gz
Algorithm Hash digest
SHA256 2991eb8582658bac11ba6cf59569767c49251ba577aeb26d641c94e230419ab0
MD5 62a9e66d74c95d3252d3ecf6bafbcf27
BLAKE2b-256 09656fe5f82fc43317607eb2bba6556019b0b174b6d55db0a2b2ed90c1cdc325

See more details on using hashes here.

File details

Details for the file core_tests-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: core_tests-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for core_tests-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 42b4560e3b9e6b25bcbf331378b3475451495eb88a46b90b551b48a4ed292938
MD5 8c3f93ae21577a7cb1235546973e3b17
BLAKE2b-256 795ba2e59feeeec399d7124ff1543302ecd1b25b20e22989debc991aa11c533b

See more details on using hashes here.

Supported by

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