Mark unit and integration tests
authorKarl O. Pinc <kop@karlpinc.com>
Mon, 23 Nov 2020 20:22:12 +0000 (14:22 -0600)
committerKarl O. Pinc <kop@karlpinc.com>
Tue, 24 Nov 2020 16:56:21 +0000 (10:56 -0600)
tests/test_checkset.py
tests/test_exceptions.py
tests/test_path.py
tests/test_plugin.py

index 6994ef19a070f646940c4333ff1b7e3905a09669..54cafef732bd38a0144189f9d52493a75cca0143 100644 (file)
 
 # Karl O. Pinc <kop@karlpinc.com>
 
+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
     '''
index d946e10088ad9fd003cf1179cc5108d08781fea1..41a55d41e2edf4f9d12fb6ae635e84c77686672c 100644 (file)
 
 # Karl O. Pinc <kop@karlpinc.com>
 
+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'),
index 6a73059e652b50e6b12e12bd014d6a845e2d70b0..06b7997602abfb77abf9fadc6846c2ef28b3b90d 100644 (file)
@@ -19,6 +19,7 @@
 
 # Karl O. Pinc <kop@meme.com>
 
+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)
index 9ecbd9e066b3249db4481c14a087e516e7599c82..10fdfff09de6e98be2b3b4dccdbc93a00f5bce3b 100644 (file)
@@ -19,6 +19,8 @@
 
 # Karl O. Pinc <kop@karlpinc.com>
 
+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
     '''