From 9a9bafc078192317695a4f06233ea261fe147989 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 17 May 2013 11:12:56 -0500 Subject: [PATCH] Reverting "Always activate testing in every test module ever." Revert "Always activate testing in every test module ever." This reverts commit 0536306048daa0970d2e43411ba2a9bf073e570e. --- mediagoblin/tests/test_api.py | 3 --- mediagoblin/tests/test_auth.py | 4 ---- mediagoblin/tests/test_celery_setup.py | 5 ----- mediagoblin/tests/test_collections.py | 3 --- mediagoblin/tests/test_config.py | 3 --- mediagoblin/tests/test_csrf_middleware.py | 3 --- mediagoblin/tests/test_edit.py | 3 --- mediagoblin/tests/test_exif.py | 3 --- mediagoblin/tests/test_globals.py | 3 --- mediagoblin/tests/test_http_callback.py | 3 --- mediagoblin/tests/test_messages.py | 3 --- mediagoblin/tests/test_misc.py | 3 --- mediagoblin/tests/test_modelmethods.py | 6 +----- mediagoblin/tests/test_oauth.py | 3 --- mediagoblin/tests/test_pdf.py | 3 --- mediagoblin/tests/test_piwigo.py | 3 --- mediagoblin/tests/test_pluginapi.py | 3 --- mediagoblin/tests/test_processing.py | 4 ---- mediagoblin/tests/test_session.py | 4 ---- mediagoblin/tests/test_sql_migrations.py | 3 --- mediagoblin/tests/test_staticdirect.py | 4 ---- mediagoblin/tests/test_storage.py | 3 --- mediagoblin/tests/test_submission.py | 5 ----- mediagoblin/tests/test_tags.py | 4 ---- mediagoblin/tests/test_timesince.py | 3 --- mediagoblin/tests/test_workbench.py | 3 --- 26 files changed, 1 insertion(+), 89 deletions(-) diff --git a/mediagoblin/tests/test_api.py b/mediagoblin/tests/test_api.py index 00cdb137..89cf1026 100644 --- a/mediagoblin/tests/test_api.py +++ b/mediagoblin/tests/test_api.py @@ -26,9 +26,6 @@ from mediagoblin.tests.tools import fixture_add_user from .resources import GOOD_JPG, GOOD_PNG, EVIL_FILE, EVIL_JPG, EVIL_PNG, \ BIG_BLUE -from mediagoblin.tools.testing import _activate_testing -_activate_testing() - _log = logging.getLogger(__name__) diff --git a/mediagoblin/tests/test_auth.py b/mediagoblin/tests/test_auth.py index 28153677..755727f9 100644 --- a/mediagoblin/tests/test_auth.py +++ b/mediagoblin/tests/test_auth.py @@ -24,10 +24,6 @@ from mediagoblin.tests.tools import fixture_add_user from mediagoblin.tools import template, mail -from mediagoblin.tools.testing import _activate_testing -_activate_testing() - - ######################## # Test bcrypt auth funcs ######################## diff --git a/mediagoblin/tests/test_celery_setup.py b/mediagoblin/tests/test_celery_setup.py index 431d69c5..5530c6f2 100644 --- a/mediagoblin/tests/test_celery_setup.py +++ b/mediagoblin/tests/test_celery_setup.py @@ -20,11 +20,6 @@ from mediagoblin.init import celery as celery_setup from mediagoblin.init.config import read_mediagoblin_config -from mediagoblin.tools.testing import _activate_testing -_activate_testing() - - - TEST_CELERY_CONF_NOSPECIALDB = pkg_resources.resource_filename( 'mediagoblin.tests', 'fake_celery_conf.ini') diff --git a/mediagoblin/tests/test_collections.py b/mediagoblin/tests/test_collections.py index 42f0cc4c..87782f30 100644 --- a/mediagoblin/tests/test_collections.py +++ b/mediagoblin/tests/test_collections.py @@ -17,9 +17,6 @@ from mediagoblin.tests.tools import fixture_add_collection, fixture_add_user from mediagoblin.db.models import Collection, User -from mediagoblin.tools.testing import _activate_testing -_activate_testing() - def test_user_deletes_collection(test_app): # Setup db. diff --git a/mediagoblin/tests/test_config.py b/mediagoblin/tests/test_config.py index e84481f0..b13adae6 100644 --- a/mediagoblin/tests/test_config.py +++ b/mediagoblin/tests/test_config.py @@ -17,9 +17,6 @@ import pkg_resources from mediagoblin.init import config -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() CARROT_CONF_GOOD = pkg_resources.resource_filename( diff --git a/mediagoblin/tests/test_csrf_middleware.py b/mediagoblin/tests/test_csrf_middleware.py index f63c75c4..a272caf6 100644 --- a/mediagoblin/tests/test_csrf_middleware.py +++ b/mediagoblin/tests/test_csrf_middleware.py @@ -15,9 +15,6 @@ # along with this program. If not, see . from mediagoblin import mg_globals -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() def test_csrf_cookie_set(test_app): diff --git a/mediagoblin/tests/test_edit.py b/mediagoblin/tests/test_edit.py index 06cf3db0..cda2607f 100644 --- a/mediagoblin/tests/test_edit.py +++ b/mediagoblin/tests/test_edit.py @@ -21,9 +21,6 @@ from mediagoblin.db.models import User from mediagoblin.tests.tools import fixture_add_user from mediagoblin.tools import template from mediagoblin.auth.lib import bcrypt_check_password -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() class TestUserEdit(object): def setup(self): diff --git a/mediagoblin/tests/test_exif.py b/mediagoblin/tests/test_exif.py index 4d8eae49..824de3c2 100644 --- a/mediagoblin/tests/test_exif.py +++ b/mediagoblin/tests/test_exif.py @@ -23,9 +23,6 @@ except ImportError: from mediagoblin.tools.exif import exif_fix_image_orientation, \ extract_exif, clean_exif, get_gps_data, get_useful from .resources import GOOD_JPG, EMPTY_JPG, BAD_JPG, GPS_JPG -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() def assert_in(a, b): diff --git a/mediagoblin/tests/test_globals.py b/mediagoblin/tests/test_globals.py index dafd71db..fe3088f8 100644 --- a/mediagoblin/tests/test_globals.py +++ b/mediagoblin/tests/test_globals.py @@ -17,9 +17,6 @@ import pytest from mediagoblin import mg_globals -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() class TestGlobals(object): diff --git a/mediagoblin/tests/test_http_callback.py b/mediagoblin/tests/test_http_callback.py index 43b21140..a0511af7 100644 --- a/mediagoblin/tests/test_http_callback.py +++ b/mediagoblin/tests/test_http_callback.py @@ -24,9 +24,6 @@ from mediagoblin.tools import processing from mediagoblin.tests.tools import fixture_add_user from mediagoblin.tests.test_submission import GOOD_PNG from mediagoblin.tests import test_oauth as oauth -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() class TestHTTPCallback(object): diff --git a/mediagoblin/tests/test_messages.py b/mediagoblin/tests/test_messages.py index e07d88d4..22f9e800 100644 --- a/mediagoblin/tests/test_messages.py +++ b/mediagoblin/tests/test_messages.py @@ -16,9 +16,6 @@ from mediagoblin import messages from mediagoblin.tools import template -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() def test_messages(test_app): diff --git a/mediagoblin/tests/test_misc.py b/mediagoblin/tests/test_misc.py index a16ab61d..755d863f 100644 --- a/mediagoblin/tests/test_misc.py +++ b/mediagoblin/tests/test_misc.py @@ -17,9 +17,6 @@ from mediagoblin.db.base import Session from mediagoblin.db.models import User, MediaEntry, MediaComment from mediagoblin.tests.tools import fixture_add_user, fixture_media_entry -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() def test_404_for_non_existent(test_app): diff --git a/mediagoblin/tests/test_modelmethods.py b/mediagoblin/tests/test_modelmethods.py index 970587e2..427aa47c 100644 --- a/mediagoblin/tests/test_modelmethods.py +++ b/mediagoblin/tests/test_modelmethods.py @@ -17,16 +17,12 @@ # Maybe not every model needs a test, but some models have special # methods, and so it makes sense to test them here. -import mock - from mediagoblin.db.base import Session from mediagoblin.db.models import MediaEntry from mediagoblin.tests.tools import fixture_add_user -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() +import mock class FakeUUID(object): diff --git a/mediagoblin/tests/test_oauth.py b/mediagoblin/tests/test_oauth.py index 2e73c9a5..ea3bd798 100644 --- a/mediagoblin/tests/test_oauth.py +++ b/mediagoblin/tests/test_oauth.py @@ -23,9 +23,6 @@ from urlparse import parse_qs, urlparse from mediagoblin import mg_globals from mediagoblin.tools import template, pluginapi from mediagoblin.tests.tools import fixture_add_user -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() _log = logging.getLogger(__name__) diff --git a/mediagoblin/tests/test_pdf.py b/mediagoblin/tests/test_pdf.py index e86409fe..b4d1940a 100644 --- a/mediagoblin/tests/test_pdf.py +++ b/mediagoblin/tests/test_pdf.py @@ -22,9 +22,6 @@ import pytest from mediagoblin.media_types.pdf.processing import ( pdf_info, check_prerequisites, create_pdf_thumb) from .resources import GOOD_PDF as GOOD -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() @pytest.mark.skipif("not check_prerequisites()") diff --git a/mediagoblin/tests/test_piwigo.py b/mediagoblin/tests/test_piwigo.py index 4d0ea885..18f95057 100644 --- a/mediagoblin/tests/test_piwigo.py +++ b/mediagoblin/tests/test_piwigo.py @@ -16,9 +16,6 @@ import pytest from .tools import fixture_add_user -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() XML_PREFIX = "\n" diff --git a/mediagoblin/tests/test_pluginapi.py b/mediagoblin/tests/test_pluginapi.py index c4e6d6e8..73ad235e 100644 --- a/mediagoblin/tests/test_pluginapi.py +++ b/mediagoblin/tests/test_pluginapi.py @@ -26,9 +26,6 @@ from mediagoblin.init.plugins import setup_plugins from mediagoblin.init.config import read_mediagoblin_config from mediagoblin.tools import pluginapi from mediagoblin.tests.tools import get_app -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() def with_cleanup(*modules_to_delete): diff --git a/mediagoblin/tests/test_processing.py b/mediagoblin/tests/test_processing.py index 493aa77b..591add96 100644 --- a/mediagoblin/tests/test_processing.py +++ b/mediagoblin/tests/test_processing.py @@ -1,10 +1,6 @@ #!/usr/bin/env python from mediagoblin import processing -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() - class TestProcessing(object): def run_fill(self, input, format, output=None): diff --git a/mediagoblin/tests/test_session.py b/mediagoblin/tests/test_session.py index b8ea4150..78d790eb 100644 --- a/mediagoblin/tests/test_session.py +++ b/mediagoblin/tests/test_session.py @@ -15,10 +15,6 @@ # along with this program. If not, see . from mediagoblin.tools import session -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() - def test_session(): sess = session.Session() diff --git a/mediagoblin/tests/test_sql_migrations.py b/mediagoblin/tests/test_sql_migrations.py index ff3d384f..2fc4c043 100644 --- a/mediagoblin/tests/test_sql_migrations.py +++ b/mediagoblin/tests/test_sql_migrations.py @@ -28,9 +28,6 @@ from migrate import changeset from mediagoblin.db.base import GMGTableBase from mediagoblin.db.migration_tools import MigrationManager, RegisterMigration from mediagoblin.tools.common import CollectingPrinter -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() # This one will get filled with local migrations diff --git a/mediagoblin/tests/test_staticdirect.py b/mediagoblin/tests/test_staticdirect.py index 663ab68e..3a9e2fd9 100644 --- a/mediagoblin/tests/test_staticdirect.py +++ b/mediagoblin/tests/test_staticdirect.py @@ -1,8 +1,4 @@ from mediagoblin.tools import staticdirect -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() - def test_staticdirect(): sdirect = staticdirect.StaticDirect( diff --git a/mediagoblin/tests/test_storage.py b/mediagoblin/tests/test_storage.py index e5bc00de..f6f1d18f 100644 --- a/mediagoblin/tests/test_storage.py +++ b/mediagoblin/tests/test_storage.py @@ -22,9 +22,6 @@ import pytest from werkzeug.utils import secure_filename from mediagoblin import storage -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() ################ diff --git a/mediagoblin/tests/test_submission.py b/mediagoblin/tests/test_submission.py index 69f867c0..162b2d19 100644 --- a/mediagoblin/tests/test_submission.py +++ b/mediagoblin/tests/test_submission.py @@ -28,15 +28,10 @@ from mediagoblin.db.models import MediaEntry from mediagoblin.tools import template from mediagoblin.media_types.image import MEDIA_MANAGER as img_MEDIA_MANAGER from mediagoblin.media_types.pdf.processing import check_prerequisites as pdf_check_prerequisites -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() - from .resources import GOOD_JPG, GOOD_PNG, EVIL_FILE, EVIL_JPG, EVIL_PNG, \ BIG_BLUE, GOOD_PDF, GPS_JPG - GOOD_TAG_STRING = u'yin,yang' BAD_TAG_STRING = unicode('rage,' + 'f' * 26 + 'u' * 26) diff --git a/mediagoblin/tests/test_tags.py b/mediagoblin/tests/test_tags.py index 8e137b06..e25cc283 100644 --- a/mediagoblin/tests/test_tags.py +++ b/mediagoblin/tests/test_tags.py @@ -15,10 +15,6 @@ # along with this program. If not, see . from mediagoblin.tools import text -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() - def test_list_of_dicts_conversion(test_app): """ diff --git a/mediagoblin/tests/test_timesince.py b/mediagoblin/tests/test_timesince.py index 0a25613a..6579eb09 100644 --- a/mediagoblin/tests/test_timesince.py +++ b/mediagoblin/tests/test_timesince.py @@ -17,9 +17,6 @@ from datetime import datetime, timedelta from mediagoblin.tools.timesince import is_aware, timesince -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() def test_timesince(): diff --git a/mediagoblin/tests/test_workbench.py b/mediagoblin/tests/test_workbench.py index b9e99cbe..6695618b 100644 --- a/mediagoblin/tests/test_workbench.py +++ b/mediagoblin/tests/test_workbench.py @@ -22,9 +22,6 @@ from mediagoblin.tools import workbench from mediagoblin.mg_globals import setup_globals from mediagoblin.decorators import get_workbench from mediagoblin.tests.test_storage import get_tmp_filestorage, cleanup_storage -from mediagoblin.tools.testing import _activate_testing - -_activate_testing() class TestWorkbench(object): -- 2.25.1