Numerous fix-ups to C API and docs. Added tests for C API.

This commit is contained in:
Raymond Hettinger 2005-08-16 10:44:15 +00:00
parent 994c2c1c69
commit c47e01d020
4 changed files with 148 additions and 26 deletions

View file

@ -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,