現在、プロフェッショナルPlone 4開発で、4.1.2用の統合インストーラを使用しています。私は、本の明示的なビルドアウトプロセスでインストーラを使用して問題を引き起こしているのかどうかはわかりませんが、インストールされているものの実際の例を挙げるのは面倒です。今、私が作成しているポリシーパッケージのテストを実行することに問題があります。パッケージのsetup.pyでplone.app.testingを使用しているImportError
、私が持っている:
[buildout]
parts +=
test
[test]
recipe = zc.recipe.testrunner
defaults = ['--auto-color', '--auto-progress']
そして最後に、testing.py輸入:
develop.cfgでextras_require={
'test': ['plone.app.testing',]
},
を
from plone.app.testing import (
PloneSandboxLayer,
applyProfile,
PLONE_FIXTURE,
IntegrationTesting,
)
開発構成を使用してbuildoutを実行した後、テストランナーはbin/testに期待通りにインストールされます。しかし、そのパッケージのテストを実行しようとする私に、以下を与える:
$ bin/test -s ctcc.policy
bin/test:239: DeprecationWarning: zope.testing.testrunner is deprecated in favour of zope.testrunner.
/opt/plone41/buildout-cache/eggs/zope.testing-3.9.6-py2.6.egg/zope/testing/testrunner/formatter.py:28: DeprecationWarning: zope.testing.exceptions is deprecated in favour of zope.testrunner.exceptions
from zope.testing.exceptions import DocTestFailureException
Test-module import failures:
Module: ctcc.policy.tests
Traceback (most recent call last):
File "/opt/plone41/zeocluster/src/ctcc.policy/ctcc/policy/tests.py", line 2, in <module>
from ctcc.policy.testing import CTCC_POLICY_INTEGRATION_TESTING
File "/opt/plone41/zeocluster/src/ctcc.policy/ctcc/policy/testing.py", line 1, in <module>
from plone.app.testing import (
ImportError: No module named testing
私はplone.app.testingを使用できるように行うには何が必要ですか?
zope.testrunnerよりzope.testing.testrunnerを使用しているために問題が発生した場合は、正確にこれが指定されていますか? buildout configsの中でそのリファレンスを見つけることができません。
ありがとうございました。
[test]
recipe = zc.recipe.testrunner
eggs =
my.package [test]
defaults = ['--auto-color', '--auto-progress']
詳細情報:あなたはこのように、キーextra_requiresとテストスタンザであなたの卵を指定する必要が
は、私がやりましたあなたがリンクしているドキュメントを読んで、ちょうどそれが参照したドキュメントに十分にドリルダウンしなかった:http://pypi.python.org/pypi/plone.testing#adding-a-test-buildout-to-your-パッケージ –
ありがとう、これは多くの助けになりました。 –