Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests are broken #21

Open
itziakos opened this issue Sep 14, 2015 · 0 comments
Open

Integration tests are broken #21

itziakos opened this issue Sep 14, 2015 · 0 comments

Comments

@itziakos
Copy link
Member

Running the integration tests one gets two kind of errors

A. When running

python -m nose.core ./integrationtests -v

we get

test_write (test_context_performance.MultiContextTestCase) ... ok
Compare exec with Adapter to the speed of a dict. (slowdown < 2.5) ... FAIL

======================================================================
FAIL: Compare exec with Adapter to the speed of a dict. (slowdown < 2.5)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\itziakos\Projects\codetools\integrationtests\test_context_performance.py", line 219, in test_exec_is_not_slow
    assert slowdown < allowed_slowdown, msg
AssertionError: ('actual slowdown, time: 3.065822', 6.364452719815567e-05)
-------------------- >> begin captured stdout << ---------------------
[actual slowdown=3.07]
--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 49 tests in 1.340s

B. When running

python -m nose.core ./integrationtests/block

we get

ith_string (unparser_test_case.UnparseCompilerAstTestCase) ... ok
test_unary_minus (unparser_test_case.UnparseCompilerAstTestCase) ... ok
test_with (unparser_test_case.UnparseCompilerAstTestCase) ... ok

======================================================================
ERROR: Expressions
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\block_test_case.py", line 473, in test
    self._base('1+2', 3, ())
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\block_test_case.py", line 467, in _base
    self.assertEqual(value, e.evaluate(dict(mapping)))
  File "C:\Users\itziakos\Projects\codetools\codetools\blocks\block.py", line 966, in evaluate
    return eval(self._code, {}, context)
  File "c:\users\itziakos\projects\traits\traits\trait_handlers.py", line 109, in _undefined_get
    name, class_of( object ) )
TraitError: The '_code' trait of an Expression instance is a property that has no 'get' or 'set' method

======================================================================
FAIL: Doctest: codetools.blocks.analysis.Transformer
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\runtimes\default\lib\doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for codetools.blocks.analysis.Transformer
  File "C:\Users\itziakos\Projects\codetools\codetools\blocks\analysis.py", line 612, in Transformer

----------------------------------------------------------------------
File "C:\Users\itziakos\Projects\codetools\codetools\blocks\analysis.py", line 616, in codetools.blocks.analysis.Transformer
Failed example:
    from compiler_.ast.api import similar
Exception raised:
    Traceback (most recent call last):
      File "c:\runtimes\default\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest codetools.blocks.analysis.Transformer[1]>", line 1, in <module>
        from compiler_.ast.api import similar
    ImportError: No module named ast.api
----------------------------------------------------------------------
File "C:\Users\itziakos\Projects\codetools\codetools\blocks\analysis.py", line 618, in codetools.blocks.analysis.Transformer
Failed example:
    similar(ast, Transformer().transform(ast))
Exception raised:
    Traceback (most recent call last):
      File "c:\runtimes\default\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest codetools.blocks.analysis.Transformer[3]>", line 1, in <module>
        similar(ast, Transformer().transform(ast))
    NameError: name 'similar' is not defined


======================================================================
FAIL: Doctest: codetools.blocks.analysis.extract_const_assigns
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\runtimes\default\lib\doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for codetools.blocks.analysis.extract_const_assigns
  File "C:\Users\itziakos\Projects\codetools\codetools\blocks\analysis.py", line 52, in extract_const_assigns

----------------------------------------------------------------------
File "C:\Users\itziakos\Projects\codetools\codetools\blocks\analysis.py", line 56, in codetools.blocks.analysis.extract_const_assigns
Failed example:
    from compiler_.ast.api import similar
Exception raised:
    Traceback (most recent call last):
      File "c:\runtimes\default\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest codetools.blocks.analysis.extract_const_assigns[1]>", line 1, in <module>
        from compiler_.ast.api import similar
    ImportError: No module named ast.api
----------------------------------------------------------------------
File "C:\Users\itziakos\Projects\codetools\codetools\blocks\analysis.py", line 58, in codetools.blocks.analysis.extract_const_assigns
Failed example:
    similar(ast, parse('a = __a'))
Exception raised:
    Traceback (most recent call last):
      File "c:\runtimes\default\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest codetools.blocks.analysis.extract_const_assigns[3]>", line 1, in <module>
        similar(ast, parse('a = __a'))
    NameError: name 'similar' is not defined


======================================================================
FAIL: test_function_kwargs_dict_args (analysis_test_case.NameAnalysisTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\analysis_test_case.py", line 360, in test_function_kwargs_dict_args
    self.assertRaises(TypeError, test_raises, code)
AssertionError: TypeError not raised

======================================================================
FAIL: test_function_varargs_args (analysis_test_case.NameAnalysisTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\analysis_test_case.py", line 318, in test_function_varargs_args
    self.assertRaises(TypeError, test_raises, code)
AssertionError: TypeError not raised

======================================================================
FAIL: Tracebacks have correct file names and line numbers
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\block_test_case.py", line 332, in test_tracebacks
    test(tracebacks()[-1], 1, 'foo/a.py')
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\block_test_case.py", line 310, in test
    self.assertEqual(tb.tb_lineno, lineno+1)
AssertionError: 1 != 2

======================================================================
FAIL: test_if2 (unparser_test_case.UnparseCompilerAstTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\unparser_test_case.py", line 178, in test_if2
    self._check_round_trip(code)
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\unparser_test_case.py", line 389, in _check_round_trip
    self.assertEqual(desired.strip(), actual.strip())
AssertionError: 'if True: \n    \n    x = 4\nelse: \n    \n    x = 5' != 'if True: \n    \n    x = 4\n\nelse: \n    \n    x = 5'

======================================================================
FAIL: test_if3 (unparser_test_case.UnparseCompilerAstTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\unparser_test_case.py", line 187, in test_if3
    self._check_round_trip(code)
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\unparser_test_case.py", line 389, in _check_round_trip
    self.assertEqual(desired.strip(), actual.strip())
AssertionError: 'if True: \n    pass\n\nelif False: \n    pass\n\nelse: \n    pass' != 'if True: \n    pass\n\nelif False: \n    pass\n\n\nelse: \n    pass'

======================================================================
FAIL: tests if block nested in else block.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\unparser_test_case.py", line 207, in test_if5
    self._check_round_trip(code)
  File "C:\Users\itziakos\Projects\codetools\integrationtests\blocks\unparser_test_case.py", line 389, in _check_round_trip
    self.assertEqual(desired.strip(), actual.strip())
AssertionError: 'if True: \n    pass\n\nelse: \n    \n    if True: \n        pass' != 'if True: \n    pass\n\n\nelse: \n    \n    if True: \n        pass'

----------------------------------------------------------------------
Ran 137 tests in 2.158s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant