Skip to content

Commit

Permalink
Remove z3c.testsetup test collector and z3c.testsetup dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
ulif committed Apr 29, 2010
1 parent 378027d commit ef710b4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
4 changes: 3 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Grok changes
1.1 (unreleased)
================

- Nothing changed yet.
* Removed z3c.testsetup-specific test collector from grok.testing. You
can still use z3c.testsetup with grok, but have to declare the
dependency in your project's ``setup.py`` explicitly.


1.1rc1 (2010-02-25)
Expand Down
15 changes: 15 additions & 0 deletions doc/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ features (please refer to ``CHANGES.txt`` for those).
**Warning**. Please be sure to always backup your data (especially the
``Data.fs`` file) before you perform upgrades.

.. _upgrade_notes_1.1:

Upgrading to 1.1 (unreleased)
-----------------------------

* `z3c.testsetup` dependency has been removed from grok. If you use
grok.testing.register_all_tests in your testsetup, make sure to
require ``z3c.testsetup`` (and also ``zope.app.testing``, if you use
functional tests) in `setup.py` of your project and use::

import z3c.testsetsetup
z3c.testsetup.register_all_tests(...)

where you used ``grok.testing.register_all_tests(...)`` before.

.. _upgrade_notes_1.1rc1:

Upgrading to 1.1rc1 (2010-02-25)
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def read(*rnames):
'simplejson',
'z3c.autoinclude',
'z3c.flashmessage',
'z3c.testsetup',
'zc.catalog',
'zope.annotation',
'zope.app.appsetup',
Expand Down
20 changes: 0 additions & 20 deletions src/grok/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,11 @@
"""Grok test helpers
"""
import sys
import os.path
import z3c.testsetup
from zope.configuration.config import ConfigurationMachine
from grokcore.component import zcml
# Provide this import here for BBB reasons:
from grokcore.component.testing import grok_component

class GrokTestCollector(z3c.testsetup.TestCollector):

def initialize(self):
# inject the grok ftesting ZCML as fallback...
if 'zcml_config' in self.settings.keys():
return
pkg_path = os.path.dirname(self.package.__file__)
if os.path.isfile(os.path.join(pkg_path, 'ftesting.zcml')):
return
self.settings['zcml_config'] = os.path.join(
os.path.dirname(__file__), 'ftesting.zcml')
if 'layer_name' in self.settings.keys():
return
self.settings['layer_name'] = 'GrokFunctionalLayer'

def register_all_tests(pkg, *args, **kw):
return GrokTestCollector(pkg, *args, **kw)

def grok(module_name):
config = ConfigurationMachine()
zcml.do_grok('grokcore.component.meta', config)
Expand Down

0 comments on commit ef710b4

Please sign in to comment.