-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from plone/roto-backport-autopick-1.2.x
Default to picking a free port - backport to 1.2.x
- Loading branch information
Showing
2 changed files
with
6 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
from plone.testing.z2 import ZSERVER_FIXTURE | ||
import os | ||
import pkg_resources | ||
|
||
try: | ||
from plone.testing.z2 import DEFAULT_ZSERVER_PORT | ||
except ImportError: | ||
# DEFAULT_ZSERVER_PORT is not defined until plone.testing == 4.0.8 | ||
DEFAULT_ZSERVER_PORT = 55001 | ||
|
||
# plone.testing checks environment to allow overriding DEFAULT_ZSERVER_PORT | ||
ZSERVER_PORT = os.environ.get('ZSERVER_PORT', DEFAULT_ZSERVER_PORT) | ||
|
||
# Allow specifying HOST and PORT through environment variables for instance, | ||
# if tests should go through a proxy | ||
ZOPE_HOST = os.environ.get('ZOPE_HOST', 'localhost') | ||
ZOPE_PORT = os.environ.get('ZOPE_PORT', ZSERVER_PORT) | ||
ZOPE_HOST = ZSERVER_FIXTURE.host | ||
ZOPE_PORT = ZSERVER_FIXTURE.port | ||
|
||
CMFPLONE_VERSION = pkg_resources.get_distribution('Products.CMFPlone').version | ||
if CMFPLONE_VERSION.startswith('4.'): | ||
CMFPLONE_SELECTORS = 'selectors/cmfplone43.robot' | ||
elif CMFPLONE_VERSION.startswith('5.'): | ||
CMFPLONE_SELECTORS = 'selectors/cmfplone50.robot' | ||
|