From 9dbd908dc8954d3022901340372ac7bb4ad32ee2 Mon Sep 17 00:00:00 2001 From: Pavel Karateev Date: Tue, 19 Nov 2024 16:13:58 +0100 Subject: [PATCH] PCQA-696 Mute failing debugger Python 3.8 tests Reasoning to hard-code mutes: 1. Muted via TeamCity UI the tests still fail the build (see PCQA-593) 2. Muted via TeamCity UI the tests are not muted locally Tickets for muted tests ... - PCQA-591 - PCQA-592 - PCQA-697 - PCQA-698 - PCQA-699 - PCQA-700 - PCQA-702 - PCQA-703 - PCQA-704 - PCQA-705 - PCQA-706 - PCQA-707 - PCQA-708 - PCQA-709 (cherry picked from commit aefbf8129a680c8c2256462755d7306492aba4fc) IJ-MR-149693 GitOrigin-RevId: d0e782aec51b2f1a96f1c9620c2f3966075edfc3 --- .../pydev_tests/test_check_pydevconsole.py | 1 + .../pydev_tests_python/debug_constants.py | 6 ++--- .../pydev/pydev_tests_python/test_debugger.py | 23 +++++++++++-------- .../pydev_tests_python/test_pydevcoverage.py | 2 ++ .../test_smart_step_into.py | 2 ++ 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/python/helpers/pydev/pydev_tests/test_check_pydevconsole.py b/python/helpers/pydev/pydev_tests/test_check_pydevconsole.py index 9980d777f40d..6622eb3965aa 100644 --- a/python/helpers/pydev/pydev_tests/test_check_pydevconsole.py +++ b/python/helpers/pydev/pydev_tests/test_check_pydevconsole.py @@ -67,6 +67,7 @@ class Test(unittest.TestCase): socket_names = get_socket_names(2, close=True) return [socket_name[1] for socket_name in socket_names] + @pytest.mark.xfail(reason="PCQA-697") def test_server(self): # Just making sure that the singleton is created in this thread. from _pydev_bundle.pydev_ipython_console_011 import get_pydev_ipython_frontend diff --git a/python/helpers/pydev/pydev_tests_python/debug_constants.py b/python/helpers/pydev/pydev_tests_python/debug_constants.py index 68e2119a818e..263c0345bcd3 100644 --- a/python/helpers/pydev/pydev_tests_python/debug_constants.py +++ b/python/helpers/pydev/pydev_tests_python/debug_constants.py @@ -15,6 +15,6 @@ if sys.version_info[0] == 2: IS_PY26 = sys.version_info[:2] == (2, 6) IS_PY34 = sys.version_info[:2] == (3, 4) -IS_PY36 = False -if sys.version_info[0] == 3 and sys.version_info[1] == 6: - IS_PY36 = True +IS_PY36 = sys.version_info[:2] == (3, 6) +IS_PY37 = sys.version_info[:2] == (3, 7) +IS_PY38 = sys.version_info[:2] == (3, 8) diff --git a/python/helpers/pydev/pydev_tests_python/test_debugger.py b/python/helpers/pydev/pydev_tests_python/test_debugger.py index 292f51f15ac6..5cb9d8013816 100644 --- a/python/helpers/pydev/pydev_tests_python/test_debugger.py +++ b/python/helpers/pydev/pydev_tests_python/test_debugger.py @@ -129,12 +129,12 @@ def test_case_2(case_setup): @pytest.mark.parametrize( 'skip_suspend_on_breakpoint_exception, skip_print_breakpoint_exception', ( - [['NameError'], []], - [['NameError'], ['NameError']], - [[], []], # Empty means it'll suspend/print in any exception - [[], ['NameError']], - [['ValueError'], ['Exception']], - [['Exception'], ['ValueError']], # ValueError will also suspend/print since we're dealing with a NameError + pytest.param(['NameError'], [], marks=pytest.mark.xfail(reason="PCQA-698")), + (['NameError'], ['NameError']), + pytest.param([], [], marks=pytest.mark.xfail(reason="PCQA-699")), # Empty means it'll suspend/print in any exception + ([], ['NameError']), + (['ValueError'], ['Exception']), + pytest.param(['Exception'], ['ValueError'], marks=pytest.mark.xfail(reason="PCQA-700")), # ValueError will also suspend/print since we're dealing with a NameError ) ) def test_case_breakpoint_condition_exc(case_setup, skip_suspend_on_breakpoint_exception, skip_print_breakpoint_exception): @@ -664,6 +664,7 @@ def test_case_15(case_setup): writer.finished_ok = True +@pytest.mark.xfail(reason="PCQA-702") def test_case_16(case_setup): # numpy.ndarray resolver try: @@ -2190,6 +2191,7 @@ def test_fork_with_attach(case_setup_multiproc): @pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.') +@pytest.mark.xfail(reason="PCQA-703") def test_remote_debugger_basic(case_setup_remote): with case_setup_remote.test_file('_debugger_case_remote.py') as writer: writer.log.append('making initial run') @@ -2236,6 +2238,7 @@ def test_py_37_breakpoint_remote(case_setup_remote): @pytest.mark.skipif(not IS_CPYTHON or not IS_PY37_OR_GREATER, reason='CPython only test.') +@pytest.mark.xfail(reason="PCQA-591") def test_py_37_breakpoint_remote_no_import(case_setup_remote): def get_environ(writer): @@ -2274,6 +2277,7 @@ def test_py_37_breakpoint_remote_no_import(case_setup_remote): @pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.') +@pytest.mark.xfail(reason="PCQA-704") def test_remote_debugger_multi_proc(case_setup_remote): class _SecondaryMultiProcProcessWriterThread(debugger_unittest.AbstractWriterThread): @@ -2351,6 +2355,7 @@ def test_remote_debugger_multi_proc(case_setup_remote): @pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.') +@pytest.mark.xfail(reason="PCQA-705") def test_remote_unhandled_exceptions(case_setup_remote): def check_test_suceeded_msg(writer, stdout, stderr): @@ -2560,9 +2565,9 @@ def scenario_caught_and_uncaught(writer): @pytest.mark.parametrize( 'check_scenario', [ - scenario_uncaught, - scenario_caught, - scenario_caught_and_uncaught, + pytest.param(scenario_uncaught, marks=pytest.mark.xfail(reason="PCQA-706")), + pytest.param(scenario_caught, marks=pytest.mark.xfail(reason="PCQA-707")), + pytest.param(scenario_caught_and_uncaught, marks=pytest.mark.xfail(reason="PCQA-708")), ] ) def test_top_level_exceptions_on_attach(case_setup_remote, check_scenario): diff --git a/python/helpers/pydev/pydev_tests_python/test_pydevcoverage.py b/python/helpers/pydev/pydev_tests_python/test_pydevcoverage.py index 18d0c587f9e4..2c53146729de 100644 --- a/python/helpers/pydev/pydev_tests_python/test_pydevcoverage.py +++ b/python/helpers/pydev/pydev_tests_python/test_pydevcoverage.py @@ -5,6 +5,7 @@ import subprocess import tempfile import unittest +import pytest #======================================================================================================================= # Test @@ -56,6 +57,7 @@ class Test(unittest.TestCase): self.assertEqual(ref_invalid_files, invalid_files) + @pytest.mark.xfail(reason="PCQA-709") def test_pydev_analyse_invalid_files(self): with tempfile.NamedTemporaryFile(suffix=".pyx") as pyx_file: ref_valid_files = [] diff --git a/python/helpers/pydev/pydev_tests_python/test_smart_step_into.py b/python/helpers/pydev/pydev_tests_python/test_smart_step_into.py index b2b873e35a5d..e7403fb6f6eb 100644 --- a/python/helpers/pydev/pydev_tests_python/test_smart_step_into.py +++ b/python/helpers/pydev/pydev_tests_python/test_smart_step_into.py @@ -2,6 +2,7 @@ from __future__ import print_function import pytest +from _pydevd_bundle.pydevd_constants import IS_PY38 from _pydevd_bundle.smart_step_into import get_stepping_variants @@ -122,6 +123,7 @@ def test_candidates_for_consecutive_calls_py3(consecutive_calls): assert variants[4].argval == '__add__' +@pytest.mark.xfail(IS_PY38, reason="PCQA-592") def test_candidates_for_returned_object_method(returned_object_method): variants = list(get_stepping_variants(returned_object_method)) assert len(variants) == 3