andy-maier / python-yagot Goto Github PK
View Code? Open in Web Editor NEWYet Another Garbage Object Tracker for Python
License: Apache License 2.0
Yet Another Garbage Object Tracker for Python
License: Apache License 2.0
Write initial docs
Currently, each test function needs to be decorated individually.
A pytest plugin should be added to enable the tracking by command line option of pytest.
Installation of typed-ast package fails on Python 3.6 on CygWin. See this Appveyor run: https://ci.appveyor.com/project/andy-maier/python-yagot/builds/30782884/job/1e2ndn1cwgxm8b50
Should be installable. Requires Python dev packages.
+ cd yagot-0.5.0
+ /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s'
Traceback (most recent call last):
File "setup.py", line 54, in <module>
requirements = get_requirements('requirements.txt')
File "setup.py", line 34, in get_requirements
with open(requirements_file, 'r') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
error: Bad exit status from /var/tmp/rpm-tmp.JOmoYy (%build)
+ 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 =================================================================
Write docs section about tools in chapter 2.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.