Skip to main content

Copyright (c) 2011, Robert Collins <robertc@robertcollins.net>

Licensed under either the Apache License, Version 2.0 or the BSD 3-clause license at the users choice. A copy of both licenses are available in the project source as Apache-2.0 and BSD. You may not use this file except in compliance with one of these two licences.

Unless required by applicable law or agreed to in writing, software distributed under these licenses is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the license you chose for the specific language governing permissions and limitations under that license.

Zope fixtures provides Fixtures (http://pypi.python.org/pypi/fixtures) for use with Zope tests. These permit easy unit testing in Zope environments.

Dependencies

For use in a unit test suite using the included glue, one of:

  • Python 2.7

  • unittest2

  • bzrlib.tests

  • Or any other test environment that supports TestCase.addCleanup.

Writing your own glue code is easy, or you can simply use the fixtures directly without any support code.

To run the test suite for zope_fixtures, testtools is needed.

See the Fixtures documentation for overview and design information.

Stock Fixtures

ComponentsFixture

This permits overlaying registrations in the zope registry. While the fixture is setup any registrations made are local to the fixture, and will be thrown away when the fixture is torn down.

>>> from zope_fixtures import ComponentsFixture
>>> from zope.interface import Interface, implements
>>> from zope.component import getSiteManager
>>> class ITestUtility(Interface):pass
>>> class TestUtility(object):
...     implements(ITestUtility)
>>> with ComponentsFixture():
...     getSiteManager().registerUtility(TestUtility())

UtilityFixture

This permits simple replacement of a single utility.

>>> from zope_fixtures import UtilityFixture
>>> with UtilityFixture(TestUtility()):
...     pass

Release files for zope_fixtures 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zope_fixtures 0.0.3
File Size Uploaded
zope_fixtures-0.0.3.tar.gz 11.1 kB Details

Release files / zope_fixtures-0.0.3.tar.gz

Download URL zope_fixtures-0.0.3.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f426db92ac1f6d812711ff08b6f7486821a96e7978f7efac6117f3f884121e55
BLAKE2b-256 checksum
How to use checksums
2bc90b29e397eb383390e3b964b9d44eabe5604dd746e2875ccf4a37a55147c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.2

1 release file

0.0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page