Skip to content

0.5.0: pytest is failing #56

Description

@kloczek
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-yagot-0.5.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-yagot-0.5.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/python3 -Bm pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/python-yagot-0.5.0
plugins: yagot-0.5.0, forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, cov-2.11.1, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, pyfakefs-4.4.0, freezegun-0.4.2, cases-3.4.6, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, flaky-3.7.0, requests-mock-1.9.2, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, hypothesis-6.13.6
collected 104 items

. .                                                                                                                                                                  [  0%]
examples/test_1.py .                                                                                                                                                 [  1%]
examples/test_2.py F                                                                                                                                                 [  2%]
tests/plugintest/test_plugin.py .......x                                                                                                                             [ 10%]
tests/unittest/test_decorator.py .x..                                                                                                                                [ 14%]
tests/unittest/test_garbagetracker.py .........................................................................................                                      [100%]

================================================================================= FAILURES =================================================================================
____________________________________________________________________________ test_selfref_dict _____________________________________________________________________________

args = (), kwargs = {}, tracker = <yagot._garbagetracker.GarbageTracker object at 0x7fbe813cd1c0>, ret = None, location = 'test_2::test_selfref_dict'
@py_assert1 = [{'self': {'self': {'self': {'self': {'self': {...}}}}}}], @py_assert3 = False
@py_format4 = "\n~There were 1 collected or uncollectable object(s) caused by function test_2::test_selfref_dict:\n~\n~1: <class 'di...': {'self': {'self': {'self': {...}}}}}}] = <yagot._garbagetracker.GarbageTracker object at 0x7fbe813cd1c0>.garbage\n}"

    @functools.wraps(func)
    def wrapper_garbage_checked(*args, **kwargs):
        "Wrapper function for the garbage_checked decorator"
        tracker = GarbageTracker.get_tracker()
        tracker.enable(leaks_only=leaks_only)
        tracker.start()
        tracker.ignore_types(type_list=ignore_types)
        ret = func(*args, **kwargs)  # The decorated function
        tracker.stop()
        location = "{module}::{function}".format(
            module=func.__module__, function=func.__name__)
>       assert not tracker.garbage, tracker.assert_message(location)
E       AssertionError:
E         There were 1 collected or uncollectable object(s) caused by function test_2::test_selfref_dict:
E
E         1: <class 'dict'> object at 0x7fbe8149d980:
E         {'self': <Recursive reference to dict object at 0x7fbe8149d980>}
E
E       assert not [{'self': {'self': {'self': {'self': {'self': {...}}}}}}]
E        +  where [{'self': {'self': {'self': {'self': {'self': {...}}}}}}] = <yagot._garbagetracker.GarbageTracker object at 0x7fbe813cd1c0>.garbage

yagot/_decorators.py:67: AssertionError
========================================================================= short test summary info ==========================================================================
XFAIL tests/plugintest/test_plugin.py::test_uncollectable_incref
  Increased reference count is not detected
XFAIL tests/unittest/test_decorator.py::test_leaks_selfref_1
FAILED examples/test_2.py::test_selfref_dict - AssertionError:
================================================================ 1 failed, 101 passed, 2 xfailed in 14.98s =================================================================

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions