Add pytest unit testing framework

This commit is contained in:
Kai A. Hiller
2018-11-27 15:57:11 +01:00
parent 7d5e946067
commit 4254b85628
10 changed files with 645 additions and 15 deletions
+30
View File
@@ -0,0 +1,30 @@
"""This module provides utility fixtures for testing."""
from typing import Tuple
from _pytest.fixtures import FixtureRequest
import pytest
@pytest.fixture(params=[True, False])
def boolean(request: FixtureRequest) -> bool:
return request.param
@pytest.fixture
def boolean1(boolean: bool) -> Tuple[bool]:
return (boolean,)
@pytest.fixture(params=[True, False])
def boolean2(request: FixtureRequest, boolean: bool) -> Tuple[bool, bool]:
return (boolean, request.param)
@pytest.fixture(params=[True, False])
def boolean3(
request: FixtureRequest, boolean2: Tuple[bool, bool]
) -> Tuple[bool, bool, bool]:
return (boolean2[0], boolean2[1], request.param)
# …