Ask Your Question
0

What is the best choice of test unit library for SAGE

asked 2011-10-24 03:17:51 -0500

petRUShka gravatar image

updated 2011-10-24 03:18:44 -0500

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2011-10-24 07:10:24 -0500

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

Comments

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

petRUShka gravatar imagepetRUShka ( 2011-10-25 00:13:30 -0500 )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 04:39:30 -0500 )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

Stats

Asked: 2011-10-24 03:17:51 -0500

Seen: 219 times

Last updated: Oct 24 '11