From 0a830b68911fc0240bebcf6d1d35927969896adf Mon Sep 17 00:00:00 2001 From: Rafael te Boekhorst Date: Tue, 11 Jun 2024 17:20:05 +0200 Subject: [PATCH] fix: make example runnable as a class with unittest Signed-off-by: Rafael te Boekhorst --- tests/modules/test_example.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/modules/test_example.py b/tests/modules/test_example.py index 3615560..a8829af 100644 --- a/tests/modules/test_example.py +++ b/tests/modules/test_example.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- -import pytest +import unittest from rookify.modules.example.main import ExampleHandler from rookify.modules.machine import Machine from rookify.modules.module import ModuleException -def test_preflight() -> None: - with pytest.raises(ModuleException): - ExampleHandler(Machine(), {}).preflight() +class TestExampleHandler(unittest.TestCase): + def test_preflight(self) -> None: + with self.assertRaises(ModuleException): + ExampleHandler(Machine(), {}).preflight()