Skip to content
Snippets Groups Projects
Commit 6ebefabc authored by Reinder Kraaij's avatar Reinder Kraaij :eye:
Browse files

Add Template

parent 924d1980
No related branches found
No related tags found
No related merge requests found
Pipeline #109146 passed with warnings
Pipeline: sid

#109147

    # Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
    # SPDX-License-Identifier: Apache-2.0
    """ Cool module containing functions, classes and other useful things """
    def greeter():
    """Prints a nice message"""
    print("Hello World!")
    autopep8 >= 1.7.0 # MIT
    black >= 22.0.0 # MIT
    build >= 0.8.0 # MIT
    flake8 >= 5.0.0 # MIT
    pylint >= 2.15.0 # GPLv2
    pytest >= 7.0.0 # MIT
    pytest-cov >= 3.0.0 # MIT
    # Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
    # SPDX-License-Identifier: Apache-2.0
    """Testing of the Cool Module"""
    from unittest import TestCase
    from sid.cool_module import greeter
    class TestCoolModule(TestCase):
    """Test Case of the Cool Module"""
    def test_greeter(self):
    """Testing that the greeter does not crash"""
    greeter()
    self.assertEqual(2 + 2, 4)
    tox.ini 0 → 100644
    [tox]
    # Generative environment list to test all supported Python versions
    envlist = py3{9,10,11,12,13},black,pep8,pylint
    min_version = 4.3.3
    requires =
    tox-ignore-env-name-mismatch >= 0.2.0
    [testenv]
    usedevelop = True
    package = wheel
    wheel_build_env = .pkg
    setenv =
    PYTHONWARNINGS=default::DeprecationWarning
    deps =
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/tests/requirements.txt
    commands =
    {envpython} --version
    {envpython} -m pytest tests/{posargs}
    [testenv:coverage]
    commands =
    {envpython} --version
    {envpython} -m pytest --cov-report term --cov-report xml --cov-report html --cov=sid tests/{posargs}
    # Use generative name and command prefixes to reuse the same virtualenv
    # for all linting jobs.
    [testenv:{pep8,black,pylint,format}]
    usedevelop = False
    package = editable
    envdir = {toxworkdir}/linting
    commands =
    pep8: {envpython} -m flake8 --version
    pep8: {envpython} -m flake8 sid tests
    black: {envpython} -m black --version
    black: {envpython} -m black --check --diff sid tests
    pylint: {envpython} -m pylint --version
    pylint: {envpython} -m pylint sid tests
    format: {envpython} -m autopep8 -v -aa --in-place --recursive sid
    format: {envpython} -m autopep8 -v -aa --in-place --recursive tests
    format: {envpython} -m black -v sid tests
    [testenv:docs]
    ; unset LC_ALL / LANGUAGE from testenv, would fail sphinx otherwise
    setenv =
    deps =
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/docs/requirements.txt
    changedir = {toxinidir}
    commands =
    {envpython} docs/cleanup.py
    sphinx-build -b html docs/source docs/build/html
    [testenv:build]
    usedevelop = False
    deps = build
    commands = {envpython} -m build
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment