[lldb/tests] Removed add_test_categories decorator for python API tests, NFC

There is a .categories file in the python_api directory that makes all nested tests
belong to the category "pyapi". The decorator is unnecessary for these tests.
This commit is contained in:
Tatyana Krasnukha
2021-02-04 01:02:31 +03:00
parent f9c5e1664e
commit 05d7d6949c
47 changed files with 1 additions and 177 deletions

View File

@@ -119,7 +119,6 @@ class FileHandleTestCase(lldbtest.TestBase):
return ret.GetOutput()
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_legacy_file_out_script(self):
with open(self.out_filename, 'w') as f:
@@ -135,7 +134,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(readStrippedLines(f), ['2', 'FOO'])
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_legacy_file_out(self):
with open(self.out_filename, 'w') as f:
@@ -144,7 +142,6 @@ class FileHandleTestCase(lldbtest.TestBase):
with open(self.out_filename, 'r') as f:
self.assertIn('deadbeef', f.read())
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_legacy_file_err_with_get(self):
with open(self.out_filename, 'w') as f:
@@ -159,7 +156,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(re.search(r'FOOBAR', errors))
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_legacy_file_err(self):
with open(self.out_filename, 'w') as f:
@@ -169,7 +165,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertIn("is not a valid command", f.read())
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_legacy_file_error(self):
with open(self.out_filename, 'w') as f:
@@ -179,7 +174,6 @@ class FileHandleTestCase(lldbtest.TestBase):
errors = f.read()
self.assertTrue(re.search(r'error:.*lolwut', errors))
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_type_errors(self):
sbf = lldb.SBFile()
@@ -190,7 +184,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertRaises(Exception, sbf.Read, u"ham sandwich")
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_write_fileno(self):
with open(self.out_filename, 'w') as f:
@@ -205,7 +198,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(readStrippedLines(f), ['FOO', 'BAR'])
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_write(self):
with open(self.out_filename, 'w') as f:
@@ -219,7 +211,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(f.read().strip(), 'FOO')
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_read_fileno(self):
with open(self.out_filename, 'w') as f:
@@ -233,7 +224,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(buffer[:n], b'FOO')
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_read(self):
with open(self.out_filename, 'w') as f:
@@ -249,7 +239,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(f.closed)
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_fileno_out(self):
with open(self.out_filename, 'w') as f:
@@ -264,7 +253,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(readStrippedLines(f), ['3', 'quux'])
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_fileno_help(self):
with open(self.out_filename, 'w') as f:
@@ -276,7 +264,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(re.search(r'Show a list of all debugger commands', f.read()))
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_help(self):
with open(self.out_filename, 'w') as f:
@@ -287,7 +274,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertIn('Show a list of all debugger commands', f.read())
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_immediate(self):
with open(self.out_filename, 'w') as f:
@@ -304,7 +290,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(re.search(r'QUUX', output))
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_immediate_string(self):
@@ -321,7 +306,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(re.search(r'QUUX', output))
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_immediate_sbfile_string(self):
@@ -337,7 +321,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(re.search(r'Show a list of all debugger commands', output))
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_fileno_inout(self):
with open(self.in_filename, 'w') as f:
@@ -361,7 +344,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(re.search(r'Show a list of all debugger commands', f.read()))
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_inout(self):
with open(self.in_filename, 'w') as f:
@@ -380,7 +362,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertIn('Show a list of all debugger commands', output)
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_binary_inout(self):
with open(self.in_filename, 'w') as f:
@@ -399,7 +380,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertIn('Show a list of all debugger commands', output)
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_string_inout(self):
@@ -417,7 +397,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertIn('0xfff', output)
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_bytes_inout(self):
@@ -435,7 +414,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertIn(b'Set a breakpoint', output)
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_fileno_error(self):
with open(self.out_filename, 'w') as f:
@@ -454,7 +432,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(re.search(r'zork', errors))
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_replace_stdout(self):
f = io.StringIO()
@@ -465,7 +442,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(sys.stdout, f)
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_replace_stdout_with_nonfile(self):
f = io.StringIO()
@@ -481,7 +457,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(f.getvalue(), "FOO")
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_write_borrowed(self):
with open(self.out_filename, 'w') as f:
@@ -497,7 +472,6 @@ class FileHandleTestCase(lldbtest.TestBase):
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_write_forced(self):
@@ -519,7 +493,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(f.read().strip(), 'FOO')
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_write_forced_borrowed(self):
@@ -541,7 +514,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(f.read().strip(), 'FOO')
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_write_string(self):
@@ -555,7 +527,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(f.closed)
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_string_out(self):
@@ -566,7 +537,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(f.getvalue().strip(), "'foobar'")
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_string_error(self):
@@ -578,7 +548,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(re.search(r'error:.*lolwut', errors))
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_write_bytes(self):
@@ -591,7 +560,6 @@ class FileHandleTestCase(lldbtest.TestBase):
sbf.Close()
self.assertTrue(f.closed)
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_read_string(self):
@@ -603,7 +571,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(buf[:n], b'zork')
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_read_string_one_byte(self):
@@ -616,7 +583,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(e.GetCString(), "can't read less than 6 bytes from a utf8 text stream")
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_read_bytes(self):
@@ -628,7 +594,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(buf[:n], b'zork')
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_out(self):
@@ -641,7 +606,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(f.read().strip(), '4')
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_file_out(self):
@@ -653,7 +617,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(f.read().strip(), '4')
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbfile_error(self):
with open(self.out_filename, 'w') as f:
@@ -666,7 +629,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(re.search(r'error:.*lolwut', errors))
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_file_error(self):
with open(self.out_filename, 'w') as f:
@@ -678,7 +640,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(re.search(r'error:.*lolwut', errors))
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_exceptions(self):
self.assertRaises(Exception, lldb.SBFile, None)
@@ -697,7 +658,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertIn('OH NOE', error.GetCString())
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_exceptions_logged(self):
@@ -709,7 +669,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(any('OH NOE' in msg for msg in messages))
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_flush(self):
@@ -740,7 +699,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertFalse(f.closed)
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_fileno_flush(self):
with open(self.out_filename, 'w') as f:
@@ -762,7 +720,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(f.read(), 'foobar')
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_close(self):
with open(self.out_filename, 'w') as f:
@@ -781,7 +738,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertTrue(re.search(r'ZAP', output))
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_stdout(self):
@@ -792,7 +748,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(f.getvalue().strip().split(), ["foobar", "7"])
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_stdout_file(self):
with open(self.out_filename, 'w') as f:
@@ -808,7 +763,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(lines, ["foobar"])
@add_test_categories(['pyapi'])
@skipIf(py_version=['<', (3,)])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_identity(self):
@@ -865,7 +819,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual("foobar", f.read().strip())
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_back_and_forth(self):
with open(self.out_filename, 'w') as f:
@@ -885,7 +838,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(list(range(10)), list(map(int, f.read().strip().split())))
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_set_filehandle_none(self):
self.assertRaises(Exception, self.dbg.SetOutputFile, None)
@@ -924,7 +876,6 @@ class FileHandleTestCase(lldbtest.TestBase):
self.assertEqual(sbf.GetFile().fileno(), 0)
@add_test_categories(['pyapi'])
@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
def test_sbstream(self):