user618815
user618815

Reputation:

Test suites for the implementation of Python?

I have implemented a subset of Python, and I need to find some test suites that are used to testing the implementation of Python (yeah, the language itself), something like the test suites used by SpiderMonkey to test the implementation of Javascript, so I am expecting some authoritative, or open sourced that are widely (or actually) used ones....

Upvotes: 3

Views: 556

Answers (2)

sbz
sbz

Reputation: 1031

Yes you can run the CPython test suite inside the python interpreter.

You should have the test package present in your python installation located into the file PREFIX/lib/pythonX.Y/test/__init__.py or you can find it using the command above:

$ ls -1F $(python -c 'import test; import os; print(test.__file__)')

In order to run the test suite, you just have to type:

>>> from test import autotest

Source: https://docs.python.org/devguide/runtests.html

Upvotes: 0

grifaton
grifaton

Reputation: 4046

If you download the CPython source from http://hg.python.org/cpython/, you'll find a massive suite of tests in Lib/tests. These might be of some use.

Upvotes: 3

Related Questions