Skip to content

1.1.4: pytest is failing #338

@kloczek

Description

@kloczek

I'm trying to package your module as rpm packag. So I'm using typical in such case build, install and test cycle used on building package from non-root account:

  • "setup.py build"
  • "setup.py install --root </install/prefix>"
  • "pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

May I ask for help because few units are failing:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-mako-1.1.4-6.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-mako-1.1.4-6.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -q
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=3899787145
rootdir: /home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4, configfile: setup.cfg
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, checkdocs-2.7.1, anyio-3.3.0, Faker-8.11.0, asyncio-0.15.1, trio-0.7.0, httpbin-1.0.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, randomly-3.8.0
collected 471 items

test/ext/test_babelplugin.py ......                                                                                                                                  [  1%]
test/test_exceptions.py ..................                                                                                                                           [  5%]
test/ext/test_linguaplugin.py s                                                                                                                                      [  5%]
test/test_filters.py .................s..s...s....                                                                                                                   [ 11%]
test/test_lexer.py ..........................................                                                                                                        [ 20%]
test/test_lookup.py .........                                                                                                                                        [ 22%]
test/test_lru.py .                                                                                                                                                   [ 22%]
test/test_template.py ...............................................s.........................................                                                      [ 41%]
test/test_pygen.py ............                                                                                                                                      [ 44%]
test/test_call.py .................                                                                                                                                  [ 47%]
test/test_cmd.py .......                                                                                                                                             [ 49%]
test/test_runtime.py .                                                                                                                                               [ 49%]
test/test_loop.py .........................                                                                                                                          [ 54%]
test/test_block.py ...............................                                                                                                                   [ 61%]
test/test_util.py ......                                                                                                                                             [ 62%]
test/test_tgplugin.py ......                                                                                                                                         [ 63%]
test/test_def.py .F.............................                                                                                                                     [ 70%]
test/test_inheritance.py .....F....                                                                                                                                  [ 72%]
test/test_cache.py sssssssssssssssssssssss............................................                                                                               [ 86%]
test/test_namespace.py ................................                                                                                                              [ 93%]
test/test_ast.py ........                                                                                                                                            [ 95%]
. .                                                                                                                                                                  [ 95%]
test/test_ast.py .............s..                                                                                                                                    [ 98%]
test/test_decorators.py F....                                                                                                                                        [100%]

================================================================================= FAILURES =================================================================================
__________________________________________________________________________ DefTest.test_toplevel ___________________________________________________________________________
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/test/test_def.py", line 118, in test_toplevel
    self._do_test(
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/test/__init__.py", line 81, in _do_test
    output = template.render_unicode(**template_args)
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/template.py", line 478, in render_unicode
    return runtime._render(
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/runtime.py", line 878, in _render
    _render_context(
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/runtime.py", line 919, in _render_context
    (inherit, lclcontext) = _populate_self_namespace(context, tmpl)
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/runtime.py", line 847, in _populate_self_namespace
    "self:%s" % template.uri,
AttributeError: 'DefTemplate' object has no attribute 'uri'
______________________________________________________________________ InheritanceTest.test_toplevel _______________________________________________________________________
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/test/test_inheritance.py", line 358, in test_toplevel
    assert result_lines(
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/template.py", line 473, in render
    return runtime._render(self, self.callable_, args, data)
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/runtime.py", line 878, in _render
    _render_context(
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/runtime.py", line 919, in _render_context
    (inherit, lclcontext) = _populate_self_namespace(context, tmpl)
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/runtime.py", line 847, in _populate_self_namespace
    "self:%s" % template.uri,
AttributeError: 'DefTemplate' object has no attribute 'uri'
__________________________________________________________________ DecoratorTest.test_toplevel_contextual __________________________________________________________________
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/test/test_decorators.py", line 52, in test_toplevel_contextual
    assert (
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/template.py", line 473, in render
    return runtime._render(self, self.callable_, args, data)
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/runtime.py", line 878, in _render
    _render_context(
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/runtime.py", line 919, in _render_context
    (inherit, lclcontext) = _populate_self_namespace(context, tmpl)
  File "/home/tkloczko/rpmbuild/BUILD/mako-rel_1_1_4/mako/runtime.py", line 847, in _populate_self_namespace
    "self:%s" % template.uri,
AttributeError: 'DefTemplate' object has no attribute 'uri'
========================================================================= short test summary info ==========================================================================
SKIPPED [1] test/ext/test_linguaplugin.py:29: 'test_extract' skipped: lingua not installed: skipping linguaplugin test
SKIPPED [1] test/test_filters.py:91: 'test_quoting_non_unicode' skipped: Requires Python 2.xx
SKIPPED [1] test/test_filters.py:192: 'test_encode_filter_non_str_we_return_bytes' skipped: Requires Python 2.xx
SKIPPED [1] test/test_filters.py:106: 'test_url_escaping_non_unicode' skipped: Requires Python 2.xx
SKIPPED [1] test/test_template.py:546: 'test_bytestring_passthru' skipped: Requires Python 2.xx
SKIPPED [1] test/test_cache.py:321: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:94: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:500: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:565: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:141: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:192: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:172: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:481: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:552: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:461: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:577: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:220: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:290: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:622: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:440: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:262: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:588: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:408: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:350: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:380: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:515: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:605: dogpile.cache is required to run these tests
SKIPPED [1] test/test_cache.py:122: dogpile.cache is required to run these tests
SKIPPED [1] test/test_ast.py:211: 'test_locate_identifiers_15' skipped: Requires Python 2.xx
FAILED test/test_def.py::DefTest::test_toplevel - AttributeError: 'DefTemplate' object has no attribute 'uri'
FAILED test/test_inheritance.py::InheritanceTest::test_toplevel - AttributeError: 'DefTemplate' object has no attribute 'uri'
FAILED test/test_decorators.py::DecoratorTest::test_toplevel_contextual - AttributeError: 'DefTemplate' object has no attribute 'uri'
================================================================ 3 failed, 438 passed, 29 skipped in 14.36s ================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions