Ask Your Question

What is the best choice of test unit library for SAGE

asked 2011-10-24 10:17:51 +0200

petRUShka gravatar image

updated 2011-10-24 10:18:44 +0200

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);

      self.assertNotEqual(CheckLocalTestForI123(group, subgroups, 1621, 1947, 1521), -1)

What are you using and why?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-10-24 14:10:24 +0200

Jason Grout gravatar image

Lots 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 for a more in-depth look at python testing packages.

edit flag offensive delete link more


Thanks! Is it possible to use `nosetests` without running `sage -sh`?

petRUShka gravatar imagepetRUShka ( 2011-10-25 07:13:30 +0200 )edit

I 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?

Jason Grout gravatar imageJason Grout ( 2011-10-25 11:39:30 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-10-24 10:17:51 +0200

Seen: 395 times

Last updated: Oct 24 '11