Test failure with enabled warnings
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- python
- 領域
- testing-qa
研究方向
重現啟用警告時的執行,並從 testing/test_basics.py::test_stdouterrin_setnull 開始,特別檢查對 gateway_base.init_popen_io(execmodel) 的呼叫。檢查擷取的 stderr 以及相關的標準串流處理;完成的標準是測試在 Python 3.2+ 且啟用警告的情況下通過,並且沒有非預期的 ResourceWarning 輸出。
由索引模型根據 Issue 內容生成。
描述
- Bitbucket: https://bitbucket.org/hpk42/execnet/issue/31
- Originally reported by: @Arfrever
- Originally created at: 2014-03-10T19:41:54.598
Execnet has 1 additional test failure with Python >=3.2 and enabled warnings (using e.g. PYTHONWARNINGS="d,i::ImportWarning" environmental variable) due to unexpected ResourceWarning in stderr.
$ PYTHONPATH="$(pwd)" PYTHONWARNINGS="d,i::ImportWarning" py.test-3.3 testing
==================================================================== test session starts ====================================================================
platform linux -- Python 3.3.5 -- py-1.4.20 -- pytest-2.5.2
gateway test setup scope: session
execnet: /tmp/execnet/execnet/__init__.py -- 1.2.0
collected 916 items
testing/test_basics.py ...................ss.....ss.....ss.F.....
testing/test_channel.py ..s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s.
testing/test_gateway.py ..s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s...s......s.ss
testing/test_multi.py ..s.xx
testing/test_termination.py .....ss.xxxxxss
testing/test_threadpool.py ......x.......
testing/test_basics.py sssssssssssssssssssss
testing/test_channel.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_gateway.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_multi.py ssssss
testing/test_termination.py sssssssssssssss
testing/test_threadpool.py ssssssssssssss
testing/test_basics.py sssssssssssssssssssss
testing/test_channel.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_gateway.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_multi.py ssssss
testing/test_termination.py sssssssssssssss
testing/test_threadpool.py ssssssssssssss
testing/test_basics.py .....ss.....ss................ss..
testing/test_channel.py s.
testing/test_fixes.py ..
testing/test_gateway.py ............s.
testing/test_multi.py ..............
testing/test_rsync.py ...........
testing/test_serializer.py ...............
testing/test_termination.py ......ss
testing/test_xspec.py .....................ss.
========================================================================= FAILURES ==========================================================================
_____________________________________________________________ test_stdouterrin_setnull[thread] ______________________________________________________________
execmodel = <ExecModel 'thread'>
@pytest.mark.skipif("not hasattr(os, 'dup')")
def test_stdouterrin_setnull(execmodel):
cap = py.io.StdCaptureFD()
gateway_base.init_popen_io(execmodel)
os.write(1, "hello".encode('ascii'))
if os.name == "nt":
os.write(2, "world")
os.read(0, 1)
out, err = cap.reset()
assert not out
> assert not err
E assert not "/tmp/execnet/testing/test_basics.py:196: ResourceWarning: unclosed file <_io.TextIOWrapper name=13 mode='r' encoding=...file <_io.TextIOWrapper name=1 mode='w' encoding='UTF-8'>\n setattr(sys, patchsysdict[self.targetfd], self._oldsys)\n"
testing/test_basics.py:203: AssertionError
---------------------------------------------------------------------- Captured stderr ----------------------------------------------------------------------
/usr/lib64/python3.3/site-packages/py/_io/capture.py:77: ResourceWarning: unclosed file <_io.TextIOWrapper name=0 mode='r' encoding='UTF-8'>
setattr(sys, patchsysdict[self.targetfd], self._oldsys)
================================================================== short test summary info ==================================================================
XFAIL testing/test_multi.py::test_safe_terminate[thread]
reason: execution model 'thread' does not support task count
XFAIL testing/test_multi.py::test_safe_terminate2[thread]
reason: execution model 'thread' does not support task count
XFAIL testing/test_termination.py::test_terminate_implicit_does_trykill[sys.executable-thread]
reason: only os threading model supported
XFAIL testing/test_termination.py::test_terminate_implicit_does_trykill[python3.3-thread]
reason: only os threading model supported
XFAIL testing/test_termination.py::test_terminate_implicit_does_trykill[python3.2-thread]
reason: only os threading model supported
XFAIL testing/test_termination.py::test_terminate_implicit_does_trykill[python2.6-thread]
reason: only os threading model supported
XFAIL testing/test_termination.py::test_terminate_implicit_does_trykill[python2.7-thread]
reason: only os threading model supported
XFAIL testing/test_threadpool.py::test_limited_size[thread]
WorkerPool does not implement limited size
SKIP [54] /tmp/execnet/testing/conftest.py:66: no 'gspecs' value found
SKIP [2] /usr/lib64/python3.3/site-packages/_pytest/skipping.py:132: condition: sys.version>="3.0"
SKIP [249] /tmp/execnet/testing/conftest.py:177: could not import 'eventlet'
SKIP [17] /tmp/execnet/testing/conftest.py:129: no pypy found
SKIP [17] /tmp/execnet/testing/conftest.py:129: no jython found
SKIP [249] /tmp/execnet/testing/conftest.py:177: could not import 'gevent'
=============================================== 1 failed, 319 passed, 588 skipped, 8 xfailed in 48.32 seconds ===============================================
sys:1: ResourceWarning: unclosed <socket.socket object, fd=17, family=2, type=1, proto=0>
sys:1: ResourceWarning: gc: 4 uncollectable objects at shutdown; use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them
- 主要語言
- Python
- 星號
- 103
- 分支
- 50
- 平均合併
- 5 天 12 小時
- 30 天內合併 PR
- 4
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
pytest-dev/execnet 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 45/100
pytest-dev/execnet#374 · 3 則留言 ·
-
難度 3/5 1-2 天 新手友好度 45/100
pytest-dev/execnet#306 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 35/100
pytest-dev/execnet#279 · 1 個 reaction ·
-
Exception ignored in atexit callback / RuntimeError: can't create new thread at interpreter shutdown可能重新可做 @RonnyPfannschmidt 於 911 天前認領,目前沒有進行中的 PR。 未關閉bug
pytest-dev/execnet#271 · 4 則留言 · 已指派 1 人 ·
-
難度 5/5 一週以上 新手友好度 10/100
pytest-dev/execnet#205 ·
查看 pytest-dev/execnet 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
huggingface/smolagents#2976 ·
維護者通常 1 天內回覆
-
bug Triage-Needed
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 66/100
FuRongJun-1999/dsh-memory#170 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
pgvector/pgvector-python#163 ·
-
難度 1/5 1 小時以內 新手友好度 82/100
521xueweihan/HelloGitHub#3940 ·