Skip to content
Snippets Groups Projects
Commit 1b316b32 authored by Florentin Labelle's avatar Florentin Labelle
Browse files

Add linting CI

parent 42ed25b9
Branches
No related tags found
No related merge requests found
image: python:3.10
stages:
- dependencies
- lint
download_dependencies:
stage: dependencies
before_script:
- venv .venv
- source .venv/bin/activate
script:
- pip install -r requirements.txt
artifacts:
paths:
- .venv
pylint:
stage: lint
dependencies:
- download_dependencies
needs:
- download_dependencies
before_script:
- pip install pylint
script:
- pylint calculator --fail-on=error
......@@ -22,3 +22,11 @@ STANDARD_OPERATORS = {
'*': Operator('×', 2, lambda a, b: a * b),
'/': Operator('/', 2, lambda a, b: a / b),
}
def test_operator():
"""
Test the Operator class.
"""
operator = Operator('%', 1, lambda a, b: a % b)
assert repr(operator) == '%'
assert operator(15, 4) == 3
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment