From: Karl O. Pinc Date: Tue, 24 Nov 2020 18:24:35 +0000 (-0600) Subject: Mark unit and integration tests X-Git-Url: https://papio.biology.duke.edu/gitweb/?a=commitdiff_plain;h=b889d99c3bddf758b9c9fa2e37f2a2ae146c5932;p=pgwui_develop Mark unit and integration tests --- diff --git a/setup.cfg b/setup.cfg index f290ea5..6293faa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,3 +8,6 @@ universal=1 # imported a module. Necessary for testing fixtures. # See: https://pytest-cov.readthedocs.io/en/latest/plugins.html addopts = --cov --cov-append +markers = + unittest + integrationtest diff --git a/tests/test_pytest_plugin.py b/tests/test_pytest_plugin.py index 6f03215..7557e6f 100644 --- a/tests/test_pytest_plugin.py +++ b/tests/test_pytest_plugin.py @@ -22,6 +22,8 @@ # See: https://pytest-cov.readthedocs.io/en/latest/plugins.html +import pytest + # Allow use of the testdir fixture pytest_plugins = ("pytester",) @@ -32,6 +34,7 @@ pytest_plugins = ("pytester",) # pgwui_component_entry_point() # pgwui_check_settings_entry_point() +@pytest.mark.unittest def test_pgwui_testing_fixtures(testdir): '''Test the fixtures supplied by the pytest_plugin module ''' diff --git a/tests/test_pytest_plugin_helpers.py b/tests/test_pytest_plugin_helpers.py index 09cb066..919e738 100644 --- a/tests/test_pytest_plugin_helpers.py +++ b/tests/test_pytest_plugin_helpers.py @@ -22,11 +22,14 @@ # See: https://pytest-cov.readthedocs.io/en/latest/plugins.html +import pytest + from pgwui_testing import pytest_plugin_helpers # pgwui_entry_point() +@pytest.mark.unittest def test_pgwui_entry_point_there(monkeypatch): '''True when the component is a pgwui.components entry point ''' @@ -45,6 +48,7 @@ def test_pgwui_entry_point_there(monkeypatch): is True) +@pytest.mark.unittest def test_pgwui_entry_point_not_there(monkeypatch): '''False when the component is not pgwui.components entry point ''' diff --git a/tests/test_testing.py b/tests/test_testing.py index 28c2c72..a9a8508 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -23,6 +23,8 @@ # See: https://pytest-cov.readthedocs.io/en/latest/plugins.html +import pytest + import sys from pgwui_testing import testing @@ -43,6 +45,7 @@ mocked_func = testing.make_mock_fixture( sys.modules[__name__], 'func_to_mock') +@pytest.mark.integrationtest def test_make_mock_fixture_fixture(mocked_func): # The mock of the function works @@ -70,6 +73,7 @@ class TestClass(): mocked_method = testing.instance_method_mock_fixture('method_to_mock') +@pytest.mark.integrationtest def test_instance_method_mock_fixture(mocked_method): # The mock of the instance method works