Closed mtelka closed 1 year ago
Marcel Telka wrote at 2023-2-1 05:37 -0800:
There are few ResourceWarnings printed during testing. ... $(PYTHON_DIR)/vendor-packages/zope/testrunner/tests/testrunner-ex/gc-after-test.py:61: ResourceWarning: not closed warn(ResourceWarning("not closed")) $(PYTHON_DIR)/vendor-packages/zope/testrunner/tests/testrunner-ex/gc-after-test.py:61: ResourceWarning: not closed warn(ResourceWarning("not closed")) $(PYTHON_DIR)/vendor-packages/zope/testrunner/tests/testrunner-ex/gc-after-test.py:61: ResourceWarning: not closed warn(ResourceWarning("not closed"))
The ResourceWwarning
s from the gc-after-test
tests
are there by purpose:
The option --gc-after-test
has the purpose to associate
the warning with the test responsible for the resource leakage.
Without this option, some resource leaks are only detected
during the next garbage collection -- potentially far away from the
responsible test.
In order to verify that the leaks are reported for the corresponding
test, the gc-after-test
tests create intensionally resource leaks.
Unfortunately, it is very difficult to prevent the resource warnings
to be output to stderr
. If you have an idea, a PR is welcome.
In https://github.com/zopefoundation/zope.testrunner/commit/f10acf0679271f3e6b72a4e286cdf7624bcd3b9a I am improving the error message of the resource warning. It seems that this is the best we can do for now.
BUG/PROBLEM REPORT / FEATURE REQUEST
There are few ResourceWarnings printed during testing.
What I did:
What I expect to happen:
No ResourceWarnings printed.
What actually happened:
What version of Python and Zope/Addons I am using:
OS: OpenIndiana Python: 3.7.16 & 3.9.16 zope.testrunner: 5.6