Commit 8dc43032 authored by Brett Cannon's avatar Brett Cannon

Rename the test_traceback_print() function to traceback_print() to prevent

test_capi from automatically calling the function.
parent b8bdbc04
"""Test cases for traceback module""" """Test cases for traceback module"""
from _testcapi import test_traceback_print from _testcapi import traceback_print
from StringIO import StringIO from StringIO import StringIO
import sys import sys
import unittest import unittest
...@@ -13,7 +13,7 @@ try: ...@@ -13,7 +13,7 @@ try:
except KeyError: except KeyError:
type_, value, tb = sys.exc_info() type_, value, tb = sys.exc_info()
file_ = StringIO() file_ = StringIO()
test_traceback_print(tb, file_) traceback_print(tb, file_)
example_traceback = file_.getvalue() example_traceback = file_.getvalue()
else: else:
raise Error("unable to create test traceback string") raise Error("unable to create test traceback string")
......
...@@ -736,13 +736,13 @@ test_with_docstring(PyObject *self) ...@@ -736,13 +736,13 @@ test_with_docstring(PyObject *self)
/* To test the format of tracebacks as printed out. */ /* To test the format of tracebacks as printed out. */
static PyObject * static PyObject *
test_traceback_print(PyObject *self, PyObject *args) traceback_print(PyObject *self, PyObject *args)
{ {
PyObject *file; PyObject *file;
PyObject *traceback; PyObject *traceback;
int result; int result;
if (!PyArg_ParseTuple(args, "OO:test_traceback_print", if (!PyArg_ParseTuple(args, "OO:traceback_print",
&traceback, &file)) &traceback, &file))
return NULL; return NULL;
...@@ -792,7 +792,7 @@ static PyMethodDef TestMethods[] = { ...@@ -792,7 +792,7 @@ static PyMethodDef TestMethods[] = {
#ifdef WITH_THREAD #ifdef WITH_THREAD
{"_test_thread_state", test_thread_state, METH_VARARGS}, {"_test_thread_state", test_thread_state, METH_VARARGS},
#endif #endif
{"test_traceback_print", test_traceback_print, METH_VARARGS}, {"traceback_print", traceback_print, METH_VARARGS},
{NULL, NULL} /* sentinel */ {NULL, NULL} /* sentinel */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment