First time here? Check out the FAQ!

Ask Your Question
0

What is the best choice of test unit library for SAGE

asked 13 years ago

petRUShka gravatar image

updated 13 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 13 years ago

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.

Preview: (hide)
link

Comments

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

petRUShka gravatar imagepetRUShka ( 13 years ago )

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 ( 13 years ago )

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: 13 years ago

Seen: 494 times

Last updated: Oct 24 '11