mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Numerous fix-ups to C API and docs. Added tests for C API.
This commit is contained in:
parent
994c2c1c69
commit
c47e01d020
4 changed files with 148 additions and 26 deletions
|
@ -6,6 +6,7 @@ import copy
|
|||
import pickle
|
||||
import os
|
||||
from random import randrange, shuffle
|
||||
import sys
|
||||
|
||||
class PassThru(Exception):
|
||||
pass
|
||||
|
@ -402,6 +403,11 @@ class TestSet(TestJointOps):
|
|||
s = None
|
||||
self.assertRaises(ReferenceError, str, p)
|
||||
|
||||
# C API test only available in a debug build
|
||||
if hasattr(sys, "gettotalrefcount"):
|
||||
def test_c_api(self):
|
||||
self.assertEqual(set('abc').test_c_api(), True)
|
||||
|
||||
class SetSubclass(set):
|
||||
pass
|
||||
|
||||
|
@ -1372,7 +1378,6 @@ class TestVariousIteratorArgs(unittest.TestCase):
|
|||
#==============================================================================
|
||||
|
||||
def test_main(verbose=None):
|
||||
import sys
|
||||
from test import test_sets
|
||||
test_classes = (
|
||||
TestSet,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue