From 058d0f14d2c7e0ddeb4a25bf64f934478891881f Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Mon, 23 Nov 2020 14:22:12 -0600 Subject: [PATCH] Mark unit and integration tests --- tests/test_checkset.py | 9 +++++++++ tests/test_exceptions.py | 5 +++++ tests/test_path.py | 2 ++ tests/test_plugin.py | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/tests/test_checkset.py b/tests/test_checkset.py index 6994ef1..54cafef 100644 --- a/tests/test_checkset.py +++ b/tests/test_checkset.py @@ -20,12 +20,15 @@ # Karl O. Pinc +import pytest + import pgwui_common.exceptions as ex import pgwui_common.checkset as checkset # require_settings() +@pytest.mark.unittest def test_require_settings_good(): '''No errors when the required settings are in the config ''' @@ -37,6 +40,7 @@ def test_require_settings_good(): assert result == [] +@pytest.mark.unittest def test_require_settings_bad(): '''Errors when the required settings are not in the config ''' @@ -52,6 +56,7 @@ def test_require_settings_bad(): # unknown_settings() +@pytest.mark.unittest def test_unknown_settings_good(): '''There are no errors when all settings are known ''' @@ -63,6 +68,7 @@ def test_unknown_settings_good(): assert result == [] +@pytest.mark.unittest def test_unknown_settings_bad(): '''Errors when settings are not known ''' @@ -77,6 +83,7 @@ def test_unknown_settings_bad(): # boolean_settings() +@pytest.mark.unittest def test_boolean_settings_good(): '''No errors when boolean settings are boolean ''' @@ -88,6 +95,7 @@ def test_boolean_settings_good(): assert result == [] +@pytest.mark.unittest def test_boolean_settings_bad(): '''Errors when boolean settings are not boolean ''' @@ -101,6 +109,7 @@ def test_boolean_settings_bad(): assert isinstance(error, ex.NotBooleanSettingError) +@pytest.mark.unittest def test_boolean_settings_missing(): '''No errors when the boolean setting is missing from the config ''' diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index d946e10..41a55d4 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -19,23 +19,28 @@ # Karl O. Pinc +import pytest + import pgwui_common.exceptions as common_ex # Functional tests +@pytest.mark.unittest def test_unknownsettingkeyerror(): '''Takes an argument''' assert isinstance(common_ex.UnknownSettingKeyError('key'), common_ex.Error) +@pytest.mark.unittest def test_missingsettingerror(): '''Takes an argument''' assert isinstance(common_ex.MissingSettingError('key'), common_ex.Error) +@pytest.mark.unittest def test_notbooleansettingerror(): '''Takes two arguments''' assert isinstance(common_ex.NotBooleanSettingError('key', 'val'), diff --git a/tests/test_path.py b/tests/test_path.py index 6a73059..06b7997 100644 --- a/tests/test_path.py +++ b/tests/test_path.py @@ -19,6 +19,7 @@ # Karl O. Pinc +import pytest from pyramid.path import AssetResolver import pgwui_common.path @@ -28,6 +29,7 @@ import pgwui_common.path # asset_abspath() +@pytest.mark.integrationtest def test_asset_abspath(): '''Returns what pyramid's asset resolver returns''' asset_resolver = AssetResolver(None) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 9ecbd9e..10fdfff 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -19,6 +19,8 @@ # Karl O. Pinc +import pytest + from pgwui_common import plugin @@ -41,6 +43,7 @@ class MockPkgResources(): # find_pgwui_components() +@pytest.mark.unittest def test_find_pgwui_components(monkeypatch): '''Returns list of entry points via iter_entry_points() ''' @@ -55,6 +58,7 @@ def test_find_pgwui_components(monkeypatch): # find_pgwui_check_settings +@pytest.mark.unittest def test_find_pgwui_check_settings(monkeypatch): '''Returns a dict, keyed by name, of entry points ''' -- 2.34.1