Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f00bb03
Support functional test for Argument Clinic
colorfulappl Aug 22, 2022
a59e304
📜🤖 Added by blurb_it.
blurb-it[bot] Aug 22, 2022
2bd331e
Revert "Support functional test for Argument Clinic"
colorfulappl Aug 23, 2022
fac5b77
Add functional test for Argument Clinic
colorfulappl Aug 23, 2022
962434c
Add testcases written in C
colorfulappl Aug 23, 2022
b93b2ae
Rename _testclinicfunctionality.c to _testclinic.c
colorfulappl Oct 25, 2022
35c5f13
Add _testclinic to stdlib IGNORE list
colorfulappl Oct 25, 2022
86703de
Merge TestClinicFunctionalityC class into TestClinicFunctionality
colorfulappl Oct 25, 2022
e66d60b
Format code in _testclinic.c
colorfulappl Oct 25, 2022
f1fb377
Merge test_clinic_functionality.py into test_clinic.py
colorfulappl Oct 26, 2022
449c8fe
Simplify testcases
colorfulappl Oct 26, 2022
1553574
Merge branch 'main' into test_clinic_functionality
colorfulappl Oct 26, 2022
81fe77b
Add more testcases
colorfulappl Oct 28, 2022
7c269d0
Rename class TestClinicFunctionality to ClinicFunctionalTest
colorfulappl Nov 1, 2022
a3a3455
Fix UB problem
colorfulappl Nov 2, 2022
80ba71a
Fix refleaks
colorfulappl Nov 4, 2022
cf77785
Clean code
colorfulappl Nov 4, 2022
10ce3c7
Add PoC of GH-99233
colorfulappl Nov 8, 2022
2cc6c0a
Add PoC of GH-99240
colorfulappl Nov 8, 2022
6a2d334
Delete test cases which fail this test
colorfulappl Nov 10, 2022
d82ef72
Merge branch 'main' into test_clinic_functionality
colorfulappl Nov 10, 2022
b27b43d
Rerun `make regen-all`
colorfulappl Nov 10, 2022
1cae160
Fix leaking
colorfulappl Nov 13, 2022
fb6d3be
Fix code style
colorfulappl Nov 13, 2022
fd1ed14
Merge branch 'main' into test_clinic_functionality
colorfulappl Nov 13, 2022
e82c88a
Rerun `make regen-all`
colorfulappl Nov 13, 2022
598568c
Fix object leaking and code style
colorfulappl Nov 14, 2022
dd43f24
Change argument release order
colorfulappl Nov 14, 2022
325e35b
Rename macro
colorfulappl Nov 14, 2022
967dda6
Update news
colorfulappl Nov 14, 2022
d568683
Fix object leaking
colorfulappl Nov 14, 2022
ce337e8
Remove unnecessary logic
colorfulappl Nov 15, 2022
3314465
Merge branch 'main' into test_clinic_functionality
colorfulappl Nov 15, 2022
68277c5
Merge branch 'main' into test_clinic_functionality
colorfulappl Nov 15, 2022
da0789f
Merge branch 'main' into test_clinic_functionality
colorfulappl Nov 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Delete test cases which fail this test
  • Loading branch information
colorfulappl committed Nov 10, 2022
commit 6a2d3345735be41e8c34ae028d775c67c68a6cba
5 changes: 0 additions & 5 deletions Include/internal/pycore_global_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,6 @@ struct _Py_global_strings {
STRUCT_FOR_ID(keyfile)
STRUCT_FOR_ID(keys)
STRUCT_FOR_ID(kind)
STRUCT_FOR_ID(kw)
STRUCT_FOR_ID(kw1)
STRUCT_FOR_ID(kw2)
STRUCT_FOR_ID(lambda)
STRUCT_FOR_ID(last)
STRUCT_FOR_ID(last_node)
Expand Down Expand Up @@ -532,8 +529,6 @@ struct _Py_global_strings {
STRUCT_FOR_ID(pid)
STRUCT_FOR_ID(policy)
STRUCT_FOR_ID(pos)
STRUCT_FOR_ID(pos1)
STRUCT_FOR_ID(pos2)
STRUCT_FOR_ID(print_file_and_line)
STRUCT_FOR_ID(priority)
STRUCT_FOR_ID(progress)
Expand Down
35 changes: 0 additions & 35 deletions Include/internal/pycore_runtime_init_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 0 additions & 56 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,17 +1045,6 @@ def test_str_converter(self):
self.assertEqual(ac_tester.str_converter('a', b'b', b'c'), ('a', 'b', 'c'))
self.assertEqual(ac_tester.str_converter('a', b'b', 'c\0c'), ('a', 'b', 'c\0c'))

def test_str_converter_encoding(self):
with self.assertRaises(TypeError):
ac_tester.str_converter_encoding(1)
self.assertEqual(ac_tester.str_converter_encoding('a', 'b', 'c'), ('a', 'b', 'c'))
with self.assertRaises(TypeError):
ac_tester.str_converter_encoding('a', b'b\0b', 'c')
self.assertEqual(ac_tester.str_converter_encoding('a', b'b', bytearray([ord('c')])), ('a', 'b', 'c'))
self.assertEqual(ac_tester.str_converter_encoding('a', b'b', bytearray([ord('c'), 0, ord('c')])),
('a', 'b', 'c\x00c'))
self.assertEqual(ac_tester.str_converter_encoding('a', b'b', b'c\x00c'), ('a', 'b', 'c\x00c'))

def test_py_buffer_converter(self):
with self.assertRaises(TypeError):
ac_tester.py_buffer_converter('a', 'b')
Expand Down Expand Up @@ -1222,51 +1211,6 @@ def test_keyword_only_parameter(self):
ac_tester.keyword_only_parameter(1)
self.assertEqual(ac_tester.keyword_only_parameter(a=1), (1, ))

def test_vararg_and_posonly(self):
with self.assertRaises(TypeError):
ac_tester.vararg_and_posonly()
with self.assertRaises(TypeError):
ac_tester.vararg_and_posonly(1, b=2)
self.assertEqual(ac_tester.vararg_and_posonly(1, 2, 3, 4), (1, (2, 3, 4)))

def test_vararg(self):
with self.assertRaises(TypeError):
ac_tester.vararg()
with self.assertRaises(TypeError):
ac_tester.vararg(1, b=2)
self.assertEqual(ac_tester.vararg(1, 2, 3, 4), (1, (2, 3, 4)))

def test_vararg_with_default(self):
with self.assertRaises(TypeError):
ac_tester.vararg_with_default()
self.assertEqual(ac_tester.vararg_with_default(1, b=False), (1, (), False))
self.assertEqual(ac_tester.vararg_with_default(1, 2, 3, 4), (1, (2, 3, 4), False))
self.assertEqual(ac_tester.vararg_with_default(1, 2, 3, 4, b=True), (1, (2, 3, 4), True))

def test_vararg_with_only_defaults(self):
self.assertEqual(ac_tester.vararg_with_only_defaults(), ((), None))
self.assertEqual(ac_tester.vararg_with_only_defaults(b=2), ((), 2))
self.assertEqual(ac_tester.vararg_with_only_defaults(1, b=2), ((1, ), 2))
self.assertEqual(ac_tester.vararg_with_only_defaults(1, 2, 3, 4), ((1, 2, 3, 4), None))
self.assertEqual(ac_tester.vararg_with_only_defaults(1, 2, 3, 4, b=5), ((1, 2, 3, 4), 5))

def test_gh_32092_oob(self):
ac_tester.gh_32092_oob(1, 2, 3, 4, kw1=5, kw2=6)

def test_gh_32092_kw_pass(self):
ac_tester.gh_32092_kw_pass(1, 2, 3)

def test_gh_99233_refcount(self):
arg = '*A unique string is not referenced by anywhere else.*'
arg_refcount_origin = sys.getrefcount(arg)
ac_tester.gh_99233_refcount(arg)
arg_refcount_after = sys.getrefcount(arg)
self.assertEqual(arg_refcount_origin, arg_refcount_after)

def test_gh_99240_double_free(self):
expected_error = r'gh_99240_double_free\(\) argument 2 must be encoded string without null bytes, not str'
with self.assertRaisesRegex(TypeError, expected_error):
ac_tester.gh_99240_double_free('a', '\0b')

if __name__ == "__main__":
unittest.main()
Loading