diff --git a/.travis.yml b/.travis.yml index 5e3cfe56..58af5e26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,12 @@ python: - '3.5' - '3.6' install: +- pip install mypy - pip install coveralls - pip install pycodestyle - pip install --upgrade . script: +- mypy --ignore-missing-imports houston - pycodestyle houston - pytest test - coverage run --source=houston setup.py test diff --git a/houston/predicate.py b/houston/predicate.py index 575a8ea7..84c789b0 100644 --- a/houston/predicate.py +++ b/houston/predicate.py @@ -1,9 +1,13 @@ -__all__ = ['Predicate'] +__all__ = ['Predicate', 'Invariant', 'Postcondition', 'Precondition'] from typing import Callable import attr +from .action import Action +from .state import State +from .environment import Environment + @attr.s(frozen=True) class Predicate(object): @@ -13,13 +17,13 @@ class Predicate(object): of purposes. """ name = attr.ib(type=str) - predicate = attr.ib(type=Callable[['Action', 'State', 'Environment'], + predicate = attr.ib(type=Callable[[Action, State, Environment], bool]) def check(self, - action: 'Action', - state: 'State', - environment: 'Environment' + action: Action, + state: State, + environment: Environment ) -> bool: """ Determines whether this predicate is satisfied by a given action,