ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 25 Oct 2011 04:39:30 -0500What is the best choice of test unit library for SAGEhttps://ask.sagemath.org/question/8412/what-is-the-best-choice-of-test-unit-library-for-sage/Now I'm using
import unittest
But I'm not sure that it is the best choice in SAGE context.
Something like this
import unittest
class Test(unittest.TestCase):
def test_CheckLocalTestForI123(self):
group = gap.GenerateG(2,5,3)
generators = gap.GeneratorsOfGroup(group);
subgroups = map(lambda gen: gap.Group(gen), generators);
subgroups.reverse()
self.assertNotEqual(CheckLocalTestForI123(group, subgroups, 1621, 1947, 1521), -1)
What are you using and why?Mon, 24 Oct 2011 03:17:51 -0500https://ask.sagemath.org/question/8412/what-is-the-best-choice-of-test-unit-library-for-sage/Answer by Jason Grout for <p>Now I'm using </p>
<pre><code>import unittest
</code></pre>
<p>But I'm not sure that it is the best choice in SAGE context.</p>
<p>Something like this</p>
<pre><code>import unittest
class Test(unittest.TestCase):
def test_CheckLocalTestForI123(self):
group = gap.GenerateG(2,5,3)
generators = gap.GeneratorsOfGroup(group);
subgroups = map(lambda gen: gap.Group(gen), generators);
subgroups.reverse()
self.assertNotEqual(CheckLocalTestForI123(group, subgroups, 1621, 1947, 1521), -1)
</code></pre>
<p>What are you using and why?</p>
https://ask.sagemath.org/question/8412/what-is-the-best-choice-of-test-unit-library-for-sage/?answer=12807#post-id-12807Lots of projects (numpy, scipy, matplotlib, etc.) use nose, which you an install in Sage as a normal python package:
sage -sh
easy_install nose
See this [stack overflow question](http://stackoverflow.com/questions/191673/preferred-python-unit-testing-framework) for a more in-depth look at python testing packages.Mon, 24 Oct 2011 07:10:24 -0500https://ask.sagemath.org/question/8412/what-is-the-best-choice-of-test-unit-library-for-sage/?answer=12807#post-id-12807Comment by petRUShka for <p>Lots of projects (numpy, scipy, matplotlib, etc.) use nose, which you an install in Sage as a normal python package:</p>
<pre><code>sage -sh
easy_install nose
</code></pre>
<p>See this <a href="http://stackoverflow.com/questions/191673/preferred-python-unit-testing-framework">stack overflow question</a> for a more in-depth look at python testing packages.</p>
https://ask.sagemath.org/question/8412/what-is-the-best-choice-of-test-unit-library-for-sage/?comment=21040#post-id-21040Thanks! Is it possible to use `nosetests` without running `sage -sh`?Tue, 25 Oct 2011 00:13:30 -0500https://ask.sagemath.org/question/8412/what-is-the-best-choice-of-test-unit-library-for-sage/?comment=21040#post-id-21040Comment by Jason Grout for <p>Lots of projects (numpy, scipy, matplotlib, etc.) use nose, which you an install in Sage as a normal python package:</p>
<pre><code>sage -sh
easy_install nose
</code></pre>
<p>See this <a href="http://stackoverflow.com/questions/191673/preferred-python-unit-testing-framework">stack overflow question</a> for a more in-depth look at python testing packages.</p>
https://ask.sagemath.org/question/8412/what-is-the-best-choice-of-test-unit-library-for-sage/?comment=21036#post-id-21036I don't know. The point behind running sage -sh is that then the Sage executables are in your path. Why don't you try it and see?Tue, 25 Oct 2011 04:39:30 -0500https://ask.sagemath.org/question/8412/what-is-the-best-choice-of-test-unit-library-for-sage/?comment=21036#post-id-21036