Skip to content
Snippets Groups Projects
Commit ea23c88a authored by Bilel El Yaagoubi's avatar Bilel El Yaagoubi
Browse files

fix lint

parent 4e5179c4
No related branches found
No related tags found
No related merge requests found
Pipeline #46220 passed
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
This Calculator holds the logic for the calculator. This Calculator holds the logic for the calculator.
""" """
from calculator.operators import Operator, STANDARD_OPERATORS from calculator.operators import Operator, STANDARD_OPERATORS
from calculator.expression import Token, Term, Expression, TermExpression, OperatorExpression from calculator.expression import Term, Expression, TermExpression, OperatorExpression
class Calculator: class Calculator:
......
...@@ -3,7 +3,7 @@ Test module for the calculator module. ...@@ -3,7 +3,7 @@ Test module for the calculator module.
""" """
import pytest import pytest
from calculator.calculator import Calculator from calculator.calculator import Calculator
from calculator.operators import STANDARD_OPERATORS, Operator from calculator.operators import STANDARD_OPERATORS
@pytest.fixture(scope="module", name="setup") @pytest.fixture(scope="module", name="setup")
...@@ -21,6 +21,9 @@ def fixture_setup(): ...@@ -21,6 +21,9 @@ def fixture_setup():
def test_tokenizer(setup): def test_tokenizer(setup):
"""
Setup the test suite, by instantiating the calculator and the operators.
"""
plus, minus, times, divide, calc = setup plus, minus, times, divide, calc = setup
assert calc.tokenize("1 + 2 + 4 / 2") == [1,plus,2,plus,4,divide,2] assert calc.tokenize("1 + 2 + 4 / 2") == [1,plus,2,plus,4,divide,2]
assert calc.tokenize("1 * 0 - 4 / 2") == [1,times,0,minus,4,divide,2] assert calc.tokenize("1 * 0 - 4 / 2") == [1,times,0,minus,4,divide,2]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment