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.4.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

core_tests-1.1.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: core_tests-1.1.4.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for core_tests-1.1.4.tar.gz
Algorithm Hash digest
SHA256 e66e39b1445c7b4f2757fa0597b50a8c2044ca9710f4838a5fc438bdfbebf78a
MD5 acbceda4373e75ac2a41a00ce9777456
BLAKE2b-256 73368e88be744d760cb8dc16151a40c371f6fab78ace7cf596b03e08a005ad58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: core_tests-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for core_tests-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3ee7b758c1551761f728e19119cb4c75be11e36cea06141af7c71f9559e9b487
MD5 63c64ee40270070b0df0e8663b68f7bb
BLAKE2b-256 b390db14c724c47a5c17780bd87cb621343734bfff422d5b06a75016af7f949c

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