Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Changelog

New:

- *add item here*
- Check that tests don't run together with ZopeTestCase
[do3cc]

Fixes:

Expand Down
15 changes: 15 additions & 0 deletions src/plone/testing/z2.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from Zope2.App.schema import Zope2VocabularyRegistry
import contextlib
import os
import pkg_resources

try:
from plone.testing._z2_testbrowser import Browser
Expand All @@ -22,6 +23,12 @@
except ImportError:
HAS_ZOPE213 = False

try:
pkg_resources.get_distribution('Zope2')
HAS_ZOPETESTCASE = True
except pkg_resources.DistributionNotFound:
HAS_ZOPETESTCASE = False

_INSTALLED_PRODUCTS = {}


Expand Down Expand Up @@ -544,6 +551,14 @@ def setUpDatabase(self):
the resource stack.
"""

if HAS_ZOPETESTCASE:
from Testing.ZopeTestCase.ZopeLite import _patched as ZOPETESTCASEALERT
if HAS_ZOPETESTCASE and ZOPETESTCASEALERT:
raise Exception('You try to run plone.testing tests together with '
'ZopeTestCase tests. This will result in random '
'failures. Convert the ZopeTestCase Tests or '
'do not run them together')

import Zope2.Startup.datatypes
import App.config

Expand Down