I'm not sure if there are any functions that do what you want (i.e., give the test status programmatically). Note that doctest() and sympytestfile() work on doctests, not regular tests (doctests are the examples in the documentation, which are tested to ensure their correctness). I would suggest reading the source or runtests.py to see how the internals work. My guess is that to get what you want, it will have to be refactored a bit.
Alternately, there may be something in py.test that can do what you want. Aaron Meurer On Tue, Nov 6, 2012 at 7:25 PM, that guy <[email protected]> wrote: > * *I have been searching the docs on how testing works and how to get > information from a test on > http://docs.sympy.org/dev/modules/utilities/runtests.html. > > From my understanding, there is a tests folder for most sections of SymPy > that contain test functions. > If I run a 'test' on a file, how can I get the results of the test? > Results such as, the sys.error if the test failed, and one of > these<http://docs.sympy.org/dev/modules/utilities/runtests.html#sympy.utilities.runtests.test>symbols? > > Some things I have tried: > > from sympy.utilities.runtests import PyTestReporter, > SymPyTests,sympytestfile,doctest > reporter = PyTestReporter() > z= SymPyTests(reporter).get_test_files("sympy\\utilities") > for file in z: print sympytestfile(file) > > > from sympy.utilities.runtests import PyTestReporter, > SymPyTests,sympytestfile > reporter = PyTestReporter() > z= SymPyTests(reporter).get_test_files("sympy\\utilities") > for file in z: SymPyTests(reporter).test_file(file) > > from sympy.utilities.runtests import PyTestReporter, > SymPyTests,sympytestfile,test > reporter = PyTestReporter() > z= SymPyTests(reporter).get_test_files("sympy\\utilities") > for file in z: print test(file) #seems to just give out False > > print doctest(file) #seems to give True/False > > > Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/sympy/-/LZdgUo-O4kEJ. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
