PicklingError using live_server fixture on Windows
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
調査の方向性
まず、Python 2.7.12 を使用して Windows で live_server fixture の失敗を再現し、次に pytest_flask/plugin.py の 85 行目付近と pytest_flask/fixtures.py の 64 行目および 127 行目付近を調べます。PicklingError を発生させる multiprocessing の起動を追跡し、期待される結果が動作する live_server fixture なのか、それとも Windows サポートに関する文書化された制限なのかを明らかにします。
索引モデルが issue の本文から書いたものです。
説明
Not sure if Windows is supposed to be supported, but for me it fails on Windows 10 Python 2.7.12 with the following error when live_server fixture used:
request = <SubRequest '_push_request_context' for <Function 'test_get_url'>>
@pytest.fixture(autouse=True)
def _push_request_context(request):
"""During tests execution request context has been pushed, e.g. `url_for`,
`session`, etc. can be used in tests as is::
def test_app(app, client):
assert client.get(url_for('myview')).status_code == 200
"""
if 'app' not in request.fixturenames:
return
app = request.getfuncargvalue('app')
# Get application bound to the live server if ``live_server`` fixture
# is applyed. Live server application has an explicit ``SERVER_NAME``,
# so ``url_for`` function generates a complete URL for endpoint which
# includes application port as well.
if 'live_server' in request.fixturenames:
> app = request.getfuncargvalue('live_server').app
..\..\..\..\python-virtualenv\shadow\Lib\site-packages\pytest_flask\plugin.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\..\..\..\python-virtualenv\shadow\Lib\site-packages\pytest_flask\fixtures.py:127: in live_server
server.start()
..\..\..\..\python-virtualenv\shadow\Lib\site-packages\pytest_flask\fixtures.py:64: in start
self._process.start()
c:\python27\Lib\multiprocessing\process.py:130: in start
self._popen = Popen(self)
c:\python27\Lib\multiprocessing\forking.py:277: in __init__
dump(process_obj, to_child, HIGHEST_PROTOCOL)
c:\python27\Lib\multiprocessing\forking.py:199: in dump
ForkingPickler(file, protocol).dump(obj)
c:\python27\Lib\pickle.py:224: in dump
self.save(obj)
c:\python27\Lib\pickle.py:331: in save
self.save_reduce(obj=obj, *rv)
c:\python27\Lib\pickle.py:425: in save_reduce
save(state)
c:\python27\Lib\pickle.py:286: in save
f(self, obj) # Call unbound method with explicit self
c:\python27\Lib\pickle.py:655: in save_dict
self._batch_setitems(obj.iteritems())
c:\python27\Lib\pickle.py:687: in _batch_setitems
save(v)
c:\python27\Lib\pickle.py:286: in save
f(self, obj) # Call unbound method with explicit self
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <multiprocessing.forking.ForkingPickler instance at 0x0000000007EDBA08>
obj = <function <lambda> at 0x00000000081B9DD8>, name = '<lambda>'
pack = <built-in function pack>
def save_global(self, obj, name=None, pack=struct.pack):
write = self.write
memo = self.memo
if name is None:
name = obj.__name__
module = getattr(obj, "__module__", None)
if module is None:
module = whichmodule(obj, name)
try:
__import__(module)
mod = sys.modules[module]
klass = getattr(mod, name)
except (ImportError, KeyError, AttributeError):
raise PicklingError(
"Can't pickle %r: it's not found as %s.%s" %
> (obj, module, name))
E PicklingError: Can't pickle <function <lambda> at 0x00000000081B9DD8>: it's not found as pytest_flask.fixtures.<lambda>
- 主要言語
- Python
- スター
- 499
- フォーク
- 93
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytest-dev/pytest-flask のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
pytest-dev/pytest-flask#190 · コメント 1 件 · リアクション 1 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pytest-dev/pytest-flask#187 · コメント 7 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
pytest-dev/pytest-flask#175 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pytest-dev/pytest-flask#163 · コメント 1 件 · リアクション 1 件 ·
-
feature request
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
pytest-dev/pytest-flask#153 · コメント 1 件 ·
pytest-dev/pytest-flask の issue をすべて見る
似ている issue
-
bug status/needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
prowler-cloud/prowler#12887 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: desktop platform: macos priority: p3 status: ready type: enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
use-agent-os/agent-os#3484 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
open-telemetry/opentelemetry-python-contrib#5113 · コメント 2 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
external
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
langchain-ai/docs#6255 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信