diff options
author | Robert Collins <robertc@robertcollins.net> | 2014-09-25 14:59:29 +1200 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2014-09-25 15:01:50 +1200 |
commit | 797b17bc3a801e7ebaac4a9b48cb37b9ddf8b61c (patch) | |
tree | 40f4b9793826d603b090483d4abbbd7eefb39ba3 /fixtures/__init__.py | |
parent | 9f9d89ce718463b24cd3910b9a99efb60b3c9e1b (diff) | |
download | fixtures-git-797b17bc3a801e7ebaac4a9b48cb37b9ddf8b61c.tar.gz |
Migrate to git and pbr.
No functional changes.
Diffstat (limited to 'fixtures/__init__.py')
-rw-r--r-- | fixtures/__init__.py | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/fixtures/__init__.py b/fixtures/__init__.py new file mode 100644 index 0000000..bfbd3dd --- /dev/null +++ b/fixtures/__init__.py @@ -0,0 +1,126 @@ +# fixtures: Fixtures with cleanups for testing and convenience. +# +# Copyright (c) 2010, 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. + + +"""Fixtures provides a sensible contract for reusable test fixtures. + +It also provides glue for using these in common test runners and acts as a +common repository for widely used Fixture classes. + +See the README for a manual, and the docstrings on individual functions and +methods for details. + +Most users will want to look at TestWithFixtures and Fixture, to start with. +""" + +# same format as sys.version_info: "A tuple containing the five components of +# the version number: major, minor, micro, releaselevel, and serial. All +# values except releaselevel are integers; the release level is 'alpha', +# 'beta', 'candidate', or 'final'. The version_info value corresponding to the +# Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a +# releaselevel of 'dev' for unreleased under-development code. +# +# If the releaselevel is 'alpha' then the major/minor/micro components are not +# established at this point, and setup.py will use a version of next-$(revno). +# If the releaselevel is 'final', then the tarball will be major.minor.micro. +# Otherwise it is major.minor.micro~$(revno). +__version__ = (0, 3, 16, 'final', 0) + +__all__ = [ + 'ByteStream', + 'DetailStream', + 'EnvironmentVariable', + 'EnvironmentVariableFixture', + 'FakeLogger', + 'FakePopen', + 'Fixture', + 'FunctionFixture', + 'LogHandler', + 'LoggerFixture', + 'MethodFixture', + 'MonkeyPatch', + 'NestedTempfile', + 'PackagePathEntry', + 'PopenFixture', + 'PythonPackage', + 'PythonPathEntry', + 'StringStream', + 'TempDir', + 'TempHomeDir', + 'TestWithFixtures', + 'Timeout', + 'TimeoutException', + '__version__', + 'version', + ] + + +import pbr.version + +from fixtures.fixture import ( + Fixture, + FunctionFixture, + MethodFixture, + ) +from fixtures._fixtures import ( + ByteStream, + DetailStream, + EnvironmentVariable, + EnvironmentVariableFixture, + FakeLogger, + FakePopen, + LoggerFixture, + LogHandler, + MonkeyPatch, + NestedTempfile, + PackagePathEntry, + PopenFixture, + PythonPackage, + PythonPathEntry, + StringStream, + TempDir, + TempHomeDir, + Timeout, + TimeoutException, + ) +from fixtures.testcase import TestWithFixtures + +# same format as sys.version_info: "A tuple containing the five components of +# the version number: major, minor, micro, releaselevel, and serial. All +# values except releaselevel are integers; the release level is 'alpha', +# 'beta', 'candidate', or 'final'. The version_info value corresponding to the +# Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a +# releaselevel of 'dev' for unreleased under-development code. +# +# If the releaselevel is 'alpha' then the major/minor/micro components are not +# established at this point, and setup.py will use a version of next-$(revno). +# If the releaselevel is 'final', then the tarball will be major.minor.micro. +# Otherwise it is major.minor.micro~$(revno). + +# Uncomment when pbr 0.11 is released. +#_version = pbr.version.VersionInfo('fixtures').semantic_version() +#__version__ = _version.version_tuple() +#version = _version.release_string() +__version__ = (0, 3, 17, 'alpha', 0) + + +def test_suite(): + import fixtures.tests + return fixtures.tests.test_suite() + + +def load_tests(loader, standard_tests, pattern): + standard_tests.addTests(loader.loadTestsFromNames(["fixtures.tests"])) + return standard_tests |