Multiple test failures (Python 3.4.0, Ubuntu 14.04)

Issue #8 new
Greg Ward
created an issue

I just tried to run the tests in a fresh clone of ssh://hg@bitbucket.org/khalas/mutpy. Lots of failures:

nosetests3 mutpy/test 
FF...........F.....................................................................................................................F.FF.F...............................E......................
======================================================================
ERROR: test_change_position_from_first_to_last (mutpy.test.operators_test.SuperCallingInsertTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/src/mutpy/mutpy/test/operators_test.py", line 607, in test_change_position_from_first_to_last
    """)], with_exec=True)
  File "/data/src/mutpy/mutpy/test/operators_test.py", line 63, in assert_mutation
    mutant_code = codegen.remove_extra_lines(codegen.to_source(mutatnt))
  File "/data/src/mutpy/mutpy/codegen.py", line 75, in to_source
    generator.visit(node)
  File "/usr/lib/python3.4/ast.py", line 245, in visit
    return visitor(node)
  File "/usr/lib/python3.4/ast.py", line 253, in generic_visit
    self.visit(item)
  File "/usr/lib/python3.4/ast.py", line 245, in visit
    return visitor(node)
  File "/data/src/mutpy/mutpy/codegen.py", line 249, in visit_ClassDef
    self.body(node.body)
  File "/data/src/mutpy/mutpy/codegen.py", line 134, in body
    self.visit(stmt)
  File "/usr/lib/python3.4/ast.py", line 245, in visit
    return visitor(node)
  File "/data/src/mutpy/mutpy/codegen.py", line 214, in visit_FunctionDef
    self.signature(node.args)
  File "/data/src/mutpy/mutpy/codegen.py", line 161, in signature
    self.write('*' + node.vararg)
TypeError: Can't convert 'arg' object to str implicitly

======================================================================
FAIL: test_assert_with_message (mutpy.test.codegen_test.CodegenTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/src/mutpy/mutpy/test/codegen_test.py", line 159, in test_assert_with_message
    self.assert_code_equal("assert True, 'message'")
  File "/data/src/mutpy/mutpy/test/codegen_test.py", line 21, in assert_code_equal
    self.assertMultiLineEqual(code, generated)
AssertionError: "assert True, 'message'" != "assert , 'message'"
- assert True, 'message'
?        ----
+ assert , 'message'


======================================================================
FAIL: test_assert_without_message (mutpy.test.codegen_test.CodegenTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/src/mutpy/mutpy/test/codegen_test.py", line 162, in test_assert_without_message
    self.assert_code_equal("assert True")
  File "/data/src/mutpy/mutpy/test/codegen_test.py", line 21, in assert_code_equal
    self.assertMultiLineEqual(code, generated)
AssertionError: 'assert True' != 'assert '
- assert True
?        ----
+ assert 


======================================================================
FAIL: test_extra_line_before_while (mutpy.test.codegen_test.CodegenTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/src/mutpy/mutpy/test/codegen_test.py", line 96, in test_extra_line_before_while
    self.assert_code_equal(SIMPLE_ASSIGN + EOL + EOL + "while False:" + EOL + INDENT + PASS)
  File "/data/src/mutpy/mutpy/test/codegen_test.py", line 21, in assert_code_equal
    self.assertMultiLineEqual(code, generated)
AssertionError: 'x = 1\n\nwhile False:\n    pass' != 'x = 1\n\nwhile :\n    pass'
  x = 1

- while False:
?       -----
+ while :
      pass

======================================================================
FAIL: test_not_covered_assign_node (mutpy.test.operators_test.MutateOnlyCoveredNodesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/src/mutpy/mutpy/test/operators_test.py", line 439, in test_not_covered_assign_node
    with_coverage=True)
  File "/data/src/mutpy/mutpy/test/operators_test.py", line 67, in assert_mutation
    self.assertIn(mutant_code, mutants, msg)
AssertionError: 'pass\nif :\n    y = 2' not found in ['pass\nif False:\n    y = 2'] : 

Mutant:

pass
if :
    y = 2

Not found in:

----------

pass
if False:
    y = 2

======================================================================
FAIL: test_not_covered_expr_node (mutpy.test.operators_test.MutateOnlyCoveredNodesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/src/mutpy/mutpy/test/operators_test.py", line 451, in test_not_covered_expr_node
    with_coverage=True)
  File "/data/src/mutpy/mutpy/test/operators_test.py", line 67, in assert_mutation
    self.assertIn(mutant_code, mutants, msg)
AssertionError: '1 - 1\nif :\n    1 + 1' not found in ['1 - 1\nif False:\n    1 + 1'] : 

Mutant:

1 - 1
if :
    1 + 1

Not found in:

----------

1 - 1
if False:
    1 + 1

======================================================================
FAIL: test_not_covered_if_node (mutpy.test.operators_test.MutateOnlyCoveredNodesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/src/mutpy/mutpy/test/operators_test.py", line 445, in test_not_covered_if_node
    with_coverage=True)
  File "/data/src/mutpy/mutpy/test/operators_test.py", line 67, in assert_mutation
    self.assertIn(mutant_code, mutants, msg)
AssertionError: 'if (not ):\n    if :\n        pass' not found in ['if (not False):\n    if False:\n        pass'] : 

Mutant:

if (not ):
    if :
        pass

Not found in:

----------

if (not False):
    if False:
        pass

======================================================================
FAIL: test_not_covered_while_node (mutpy.test.operators_test.MutateOnlyCoveredNodesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/src/mutpy/mutpy/test/operators_test.py", line 457, in test_not_covered_while_node
    with_coverage=True)
  File "/data/src/mutpy/mutpy/test/operators_test.py", line 67, in assert_mutation
    self.assertIn(mutant_code, mutants, msg)
AssertionError: 'while (not ):\n    while :\n        pass' not found in ['while (not False):\n    while False:\n        pass'] : 

Mutant:

while (not ):
    while :
        pass

Not found in:

----------

while (not False):
    while False:
        pass

----------------------------------------------------------------------
Ran 191 tests in 0.192s

FAILED (errors=1, failures=7)

(I get a similar outcome with "python3 setup.py test".)

Comments (1)

  1. Log in to comment