From d1cc2e6fc2914393f06a81a2f17e1fe0396b3d42 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Thu, 17 Dec 2020 01:17:07 -0600 Subject: [PATCH] Improve pytest marking --- tests/test_testing.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_testing.py b/tests/test_testing.py index 2369983..16e17d6 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -45,6 +45,7 @@ mocked_func = testing.make_mock_fixture( sys.modules[__name__], 'func_to_mock') +@pytest.mark.unittest @pytest.mark.integrationtest def test_make_mock_fixture_fixture(mocked_func): # The mock of the function works @@ -64,6 +65,7 @@ magic_mocked_func = testing.make_magicmock_fixture( sys.modules[__name__], 'func_to_mock') +@pytest.mark.unittest @pytest.mark.integrationtest def test_make_magicmock_fixture_no_autospec(magic_mocked_func): # The mock of the function works @@ -79,6 +81,7 @@ magic_mocked_autospecced_func = testing.make_magicmock_fixture( sys.modules[__name__], 'func_to_mock', autospec=True) +@pytest.mark.unittest @pytest.mark.integrationtest def test_make_magicmock_fixture_autospec(magic_mocked_autospecced_func): # The mock of the function works @@ -107,6 +110,7 @@ class TestClass(): mocked_method = testing.instance_method_mock_fixture('method_to_mock') +@pytest.mark.unittest @pytest.mark.integrationtest def test_instance_method_mock_fixture(mocked_method): # The mock of the instance method works @@ -120,6 +124,8 @@ def test_instance_method_mock_fixture(mocked_method): assert result == test_value +@pytest.mark.unittest +@pytest.mark.integrationtest def test_instance_method_mock_fixture_unmocked(): # The test class works after the mocking -- 2.34.1