Here's the code I add at the end of the file:

def test_basic_groups():
    G = SymmetricGroup(5)
    elements = list(G.generate())
    assert len(elements) == 120
    assert G.is_solvable() == False
    C = CyclicGroup(10)
    elements = list(C.generate())
    assert len(elements) == 10
    assert (C.commutator()).order() == 1
    D = DihedralGroup(6)
    elements = list(D.generate())
    assert len(elements) == 12
    A = AlternatingGroup(5)
    elements = list(A.generate())
    assert len(elements) == 60
    assert [perm.is_even for perm in elements] == [True]*60

def test_direct_product():
    C = CyclicGroup(4)
    assert (C*C).order() == 16

What is even more peculiar is that when I exchange the order of the
two functions, everything is ok again.

On May 27, 5:08 pm, Aleksandar Makelov <[email protected]>
wrote:
> Hi all,
>
> I've been writing some tests in sympy/combinatorics/test/
> test_perm_groups.py for the new functionality I implemented in sympy/
> combinatorics/perm_groups.py. I added two test functions and got the
> following:
>
> ============================= test process starts
> ==============================
> executable:   /usr/bin/python  (2.7.3-final-0)
> architecture: 32-bit
> cache:        yes
> ground types: python
> random seed:  93988690
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "sympy/utilities/runtests.py", line 324, in test
>     return t.test(sort=sort, timeout=timeout, slow=slow)
>   File "sympy/utilities/runtests.py", line 648, in test
>     self.test_file(f, sort, timeout, slow)
>   File "sympy/utilities/runtests.py", line 695, in test_file
>     funcs.sort(key=lambda x: inspect.getsourcelines(x)[1])
>   File "sympy/utilities/runtests.py", line 695, in <lambda>
>     funcs.sort(key=lambda x: inspect.getsourcelines(x)[1])
>   File "/usr/lib/python2.7/inspect.py", line 690, in getsourcelines
>     lines, lnum = findsource(object)
>   File "/usr/lib/python2.7/inspect.py", line 580, in findsource
>     if pat.match(lines[lnum]): break
> IndexError: list index out of range
>
> When I remove the second test function I added, everything is ok
> again:
>
> ============================= test process starts
> ==============================
> executable:   /usr/bin/python  (2.7.3-final-0)
> architecture: 32-bit
> cache:        yes
> ground types: python
> random seed:  69800657
>
> sympy/combinatorics/tests/
> test_perm_groups.py[16] ....f...........          [OK]
>
> ======== tests finished: 15 passed, 1 expected to fail, in 0.64
> seconds ========
> True
>
> This has already happened with two different test functions, so I
> guess the problem is more general. Am I doing something wrong, or is
> this a more general issue?

-- 
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.

Reply via email to