django_nose cleanup: we're using py.test

This commit is contained in:
Mathieu Agopian 2014-12-19 14:54:30 +01:00
Родитель 61d608c650
Коммит 375bbdeaf4
11 изменённых файлов: 18 добавлений и 508 удалений

Просмотреть файл

@ -1 +0,0 @@
"""This file is to trick nose into recursing into the app directories."""

Просмотреть файл

@ -1,15 +0,0 @@
from django.conf import settings
from django.db.models import loading
import django_nose
class TestRunner(django_nose.NoseTestSuiteRunner):
def setup_test_environment(self, **kwargs):
rval = super(TestRunner, self).setup_test_environment(**kwargs)
extra_apps = getattr(settings, 'TEST_INSTALLED_APPS')
if extra_apps:
installed_apps = getattr(settings, 'INSTALLED_APPS')
setattr(settings, 'INSTALLED_APPS', installed_apps + extra_apps)
loading.cache.loaded = False
return rval

Просмотреть файл

@ -1,128 +0,0 @@
"""
Nose plugin to restrict access to blacklisted os modules.
Activate by running nosetests --with-ospatch or like this in local settings:
NOSE_PLUGINS = [
'amo.tests.ospatch.OSPatch',
]
NOSE_ARGS = [
'--with-ospatch',
]
This was originally made to
help identify code that needed to be ported to the Django storage API.
After breaking/fixing the tests, this command was also useful:
egrep '\bos\..*' -R apps/ | grep -v 'os.path' | grep -v 'link.os' \
| grep -v 'os.environ' | egrep -v 'os\.[A-Z]' | less
"""
import logging
import os
from traceback import extract_stack
from nose.plugins import Plugin
log = logging.getLogger('nose.plugins.ospatch')
class OSRestricted(Exception):
pass
class OSPatch(Plugin):
name = 'ospatch'
score = -1 # load after all other plugins
def options(self, parser, env=os.environ):
super(OSPatch, self).options(parser, env=env)
self.parser = parser
def configure(self, options, conf):
super(OSPatch, self).configure(options, conf)
if not self.enabled:
return
self.cmd_options = options
self.config = conf
def begin(self):
log.info('Patching os!')
import amo
# e.g. /path/to/zamboni/apps
amo_path = os.path.abspath(os.path.join(os.path.dirname(amo.__file__),
'..'))
for name in dir(os):
if (name not in ('altsep',
'curdir',
'error',
'errno',
'extsep',
'getenv',
'environ',
'getcwd',
'getpid',
'linesep',
'lstat',
'name',
'pardir',
'path',
'pathsep',
'putenv',
'sep',
'setenv',
'strerror',
'stat',
'sys',
'uname',
'urandom',)
and not name.startswith('_')
and not name[0].isupper()):
setattr(os, name, _Patch(amo_path, getattr(os, name)))
class _Patch(object):
def __init__(self, amo_path, orig):
self.amo_path = amo_path
self.orig = orig
def __call__(self, *args, **kw):
allow_call = False
is_amo = False
for filename, lineno, fn, text in extract_stack():
file_fn = '%s:%s' % (filename, fn)
if os.path.abspath(filename).startswith(self.amo_path):
is_amo = True
if ('settings_test.py' in filename
# Ignore whitelisted lib usage.
or 'tempfile.py' in filename
or 'random.py' in filename
or '/PIL/' in filename
# Ignore storage API.
or 'django/core/files/storage.py:open' in file_fn
or 'django/core/files/storage.py:exists' in file_fn
or 'django/core/files/storage.py:listdir' in file_fn
or 'django/core/files/storage.py:path' in file_fn
or 'django/core/files/storage.py:size' in file_fn
or 'django/core/files/storage.py:url' in file_fn
or 'django/core/files/storage.py:save' in file_fn
or 'django/core/files/storage.py:delete' in file_fn
or 'amo/utils.py:path' in file_fn # storage API
# These need to operate on local files.
or 'amo/utils.py:rm_local_tmp_dir' in file_fn
or 'amo/utils.py:rm_local_tmp_file' in file_fn
or 'files/utils.py:extract_xpi' in file_fn
or 'payments/models.py:generate_private_key' in file_fn
# Ignore some test code.
or 'tests/test_views_edit.py:setup_image_status' in file_fn
or 'search/tests/__init__.py:setUp' in file_fn
or 'amo/tests/__init__.py:xpi_copy_over' in file_fn):
allow_call = True
# print filename, fn
if not is_amo:
# Only detect incorrect os usage in AMO.
allow_call = True
if allow_call:
return self.orig(*args, **kw)
raise OSRestricted('cannot call %s' % self.orig)

Просмотреть файл

@ -1,341 +0,0 @@
# Sphinx inventory version 1
# Project: nose
# Version: 0.11
nose.case mod api/test_cases.html
nose.plugins.logcapture mod plugins/logcapture.html
nose.plugins.isolate mod plugins/isolate.html
nose.proxy mod api/proxy.html
nose.loader mod api/loader.html
nose.util mod api/util.html
nose.plugins.attrib mod plugins/attrib.html
nose.plugins.deprecated mod plugins/deprecated.html
nose.config mod api/config.html
nose.plugins.xunit mod plugins/xunit.html
nose.plugins.capture mod plugins/capture.html
nose.commands mod api/commands.html
nose.plugins.doctests mod plugins/doctests.html
nose.plugins.manager mod api/plugin_manager.html
nose.plugins.cover mod plugins/cover.html
nose.plugins.collect mod plugins/collect.html
nose.tools mod testing_tools.html
nose.core mod api/core.html
nose.inspector mod api/inspector.html
nose.plugins.multiprocess mod plugins/multiprocess.html
nose.plugins.errorclass mod plugins/errorclasses.html
nose.plugins mod plugins/writing.html
nose.importer mod api/importer.html
nose.twistedtools mod api/twistedtools.html
nose.plugins.allmodules mod plugins/allmodules.html
nose.plugins.failuredetail mod plugins/failuredetail.html
nose.result mod api/result.html
nose.plugins.skip mod plugins/skip.html
nose.plugins.plugintest mod plugins/testing.html
nose.selector mod api/selector.html
nose.plugins.testid mod plugins/testid.html
nose.suite mod api/suite.html
nose.plugins.prof mod plugins/prof.html
nose.plugins.debug mod plugins/debug.html
nose.proxy.ResultProxy.failures attribute api/proxy.html
nose.plugins.skip.Skip class plugins/skip.html
nose.suite.FinalizingSuiteWrapper class api/suite.html
nose.plugins.capture.Capture.buffer attribute plugins/capture.html
nose.util.test_address function api/util.html
nose.plugins.logcapture.LogCapture.afterTest method plugins/logcapture.html
nose.suite.ContextSuiteFactory.suiteClass attribute api/suite.html
nose.plugins.prof.Profile class plugins/prof.html
nose.loader.TestLoader.loadTestsFromTestClass method api/loader.html
nose.plugins.base.IPluginInterface.add_options method plugins/interface.html
nose.plugins.errorclass.ErrorClassPlugin class plugins/errorclasses.html
nose.plugins.cover.Coverage class plugins/cover.html
nose.util.absfile function api/util.html
nose.core.runmodule function api/core.html
nose.plugins.base.IPluginInterface.afterTest method plugins/interface.html
nose.util.ispackage function api/util.html
nose.config.user_config_files function api/config.html
nose.plugins.deprecated.Deprecated class plugins/deprecated.html
nose.plugins.attrib.AttributeSelector.wantMethod method plugins/attrib.html
nose.selector.Selector.wantMethod method api/selector.html
nose.plugins.base.IPluginInterface.loadTestsFromDir method plugins/interface.html
nose.plugins.attrib.AttributeSelector.wantClass method plugins/attrib.html
nose.result.TextTestResult.printSummary method api/result.html
nose.plugins.manager.BuiltinPluginManager class api/plugin_manager.html
nose.plugins.skip.Skip.options method plugins/skip.html
nose.plugins.manager.EntryPointPluginManager class api/plugin_manager.html
nose.plugins.base.IPluginInterface.beforeTest method plugins/interface.html
nose.config.Config.default method api/config.html
nose.suite.ContextSuite.exc_info method api/suite.html
nose.loader.TestLoader.loadTestsFromFile method api/loader.html
nose.loader.TestLoader class api/loader.html
nose.loader.TestLoader.parseGeneratedTest method api/loader.html
nose.tools.with_setup function testing_tools.html
nose.core.TestProgram.parseArgs method api/core.html
nose.loader.TestLoader.loadTestsFromName method api/loader.html
nose.plugins.collect.CollectOnly.options method plugins/collect.html
nose.plugins.base.IPluginInterface.loadTestsFromTestClass method plugins/interface.html
nose.plugins.capture.Capture.afterTest method plugins/capture.html
nose.plugins.doctests.Doctest.prepareTestLoader method plugins/doctests.html
nose.plugins.base.IPluginInterface.loadTestsFromName method plugins/interface.html
nose.plugins.debug.Pdb.addError method plugins/debug.html
nose.core.run function api/core.html
nose.util.isproperty function api/util.html
nose.tools.assert_almost_equal attribute testing_tools.html
nose.config.Config.configureWhere method api/config.html
nose.selector.Selector.wantClass method api/selector.html
nose.plugins.base.IPluginInterface.afterContext method plugins/interface.html
nose.config.ConfiguredDefaultsOptionParser class api/config.html
nose.plugins.base.IPluginInterface.formatError method plugins/interface.html
nose.loader.TestLoader.loadTestsFromNames method api/loader.html
nose.plugins.debug.Pdb class plugins/debug.html
nose.plugins.base.IPluginInterface.configure method plugins/interface.html
nose.proxy.ResultProxy.errors attribute api/proxy.html
nose.util.try_run function api/util.html
nose.plugins.base.IPluginInterface.setOutputStream method plugins/interface.html
nose.selector.Selector.wantFunction method api/selector.html
nose.suite.ContextSuiteFactory class api/suite.html
nose.plugins.multiprocess.MultiProcess.options method plugins/multiprocess.html
nose.plugins.base.IPluginInterface.wantMethod method plugins/interface.html
nose.plugins.allmodules.AllModules.wantModule method plugins/allmodules.html
nose.util.transplant_func function api/util.html
nose.loader.TestLoader.loadTestsFromDir method api/loader.html
nose.tools.istest function testing_tools.html
nose.plugins.skip.Skip.configure method plugins/skip.html
nose.config.Config.configure method api/config.html
nose.plugins.failuredetail.FailureDetail.formatFailure method plugins/failuredetail.html
nose.plugins.xunit.Xunit.options method plugins/xunit.html
nose.plugins.base.IPluginInterface.loadTestsFromModule method plugins/interface.html
nose.plugins.base.IPluginInterface.addError method plugins/interface.html
nose.plugins.base.IPluginInterface.loadTestsFromNames method plugins/interface.html
nose.loader.TestLoader.loadTestsFromModule method api/loader.html
nose.plugins.base.IPluginInterface class plugins/interface.html
nose.core.TestProgram.makeConfig method api/core.html
nose.importer.Importer class api/importer.html
nose.plugins.manager.BuiltinPluginManager.loadPlugins method api/plugin_manager.html
nose.twistedtools.stop_reactor function api/twistedtools.html
nose.plugins.prof.Profile.report method plugins/prof.html
nose.plugins.base.Plugin.options method plugins/interface.html
nose.plugins.base.IPluginInterface.begin method plugins/interface.html
nose.suite.ContextSuite.failureException attribute api/suite.html
nose.plugins.capture.Capture.options method plugins/capture.html
nose.plugins.xunit.Xunit.addFailure method plugins/xunit.html
nose.plugins.xunit.Xunit class plugins/xunit.html
nose.inspector.tbsource function api/inspector.html
nose.plugins.plugintest.PluginTester.setUp method plugins/testing.html
nose.loader.TestLoader.loadTestsFromGenerator method api/loader.html
nose.plugins.multiprocess.MultiProcess class plugins/multiprocess.html
nose.core.TextTestRunner.run method api/core.html
nose.suite.LazySuite class api/suite.html
nose.plugins.capture.Capture.begin method plugins/capture.html
nose.plugins.multiprocess.MultiProcess.prepareTestLoader method plugins/multiprocess.html
nose.plugins.doctests.Doctest.loadTestsFromFile method plugins/doctests.html
nose.plugins.base.IPluginInterface.options method plugins/interface.html
nose.suite.ContextSuite class api/suite.html
nose.plugins.isolate.IsolationPlugin.prepareTestLoader method plugins/isolate.html
nose.plugins.cover.Coverage.wantFile method plugins/cover.html
nose.plugins.base.IPluginInterface.addOptions method plugins/interface.html
nose.core.TextTestRunner class api/core.html
nose.plugins.capture.Capture class plugins/capture.html
nose.plugins.base.IPluginInterface.startContext method plugins/interface.html
nose.result.TextTestResult.printErrors method api/result.html
nose.tools.raises function testing_tools.html
nose.plugins.logcapture.LogCapture.formatFailure method plugins/logcapture.html
nose.plugins.base.IPluginInterface.beforeDirectory method plugins/interface.html
nose.plugins.manager.PluginManager class api/plugin_manager.html
nose.suite.ContextSuiteFactory.mixedSuites method api/suite.html
nose.inspector.find_inspectable_lines function api/inspector.html
nose.proxy.ResultProxyFactory class api/proxy.html
nose.core.collector function api/core.html
nose.tools.timed function testing_tools.html
nose.plugins.logcapture.LogCapture.formatError method plugins/logcapture.html
nose.loader.TestLoader.loadTestsFromTestCase method api/loader.html
nose.inspector.inspect_traceback function api/inspector.html
nose.util.odict class api/util.html
nose.proxy.ResultProxy class api/proxy.html
nose.plugins.doctests.Doctest.wantFile method plugins/doctests.html
nose.config.NoOptions class api/config.html
nose.util.file_like function api/util.html
nose.core.run_exit attribute api/core.html
nose.core.TestProgram.runTests method api/core.html
nose.plugins.base.IPluginInterface.afterDirectory method plugins/interface.html
nose.plugins.manager.PluginManager.configure method api/plugin_manager.html
nose.plugins.base.IPluginInterface.testName method plugins/interface.html
nose.plugins.testid.TestId.options method plugins/testid.html
nose.plugins.base.IPluginInterface.startTest method plugins/interface.html
nose.case.Test.exc_info method api/test_cases.html
nose.plugins.base.IPluginInterface.loadTestsFromFile method plugins/interface.html
nose.case.Test.runTest method api/test_cases.html
nose.plugins.cover.Coverage.report method plugins/cover.html
nose.plugins.base.Plugin.add_options method plugins/interface.html
nose.plugins.base.IPluginInterface.wantModule method plugins/interface.html
nose.plugins.debug.Pdb.configure method plugins/debug.html
nose.plugins.base.IPluginInterface.handleError method plugins/interface.html
nose.plugins.cover.Coverage.begin method plugins/cover.html
nose.plugins.capture.Capture.beforeTest method plugins/capture.html
nose.result.TextTestResult class api/result.html
nose.plugins.collect.CollectOnly class plugins/collect.html
nose.plugins.failuredetail.FailureDetail class plugins/failuredetail.html
nose.proxy.ResultProxy.testsRun attribute api/proxy.html
nose.plugins.manager.RestrictedPluginManager class api/plugin_manager.html
nose.tools.set_trace function testing_tools.html
nose.util.match_last function api/util.html
nose.util.getpackage function api/util.html
nose.plugins.logcapture.LogCapture.beforeTest method plugins/logcapture.html
nose.plugins.base.IPluginInterface.addSkip method plugins/interface.html
nose.plugins.allmodules.AllModules class plugins/allmodules.html
nose.plugins.logcapture.LogCapture.begin method plugins/logcapture.html
nose.util.transplant_class function api/util.html
nose.plugins.plugintest.PluginTester class plugins/testing.html
nose.importer.Importer.importFromDir method api/importer.html
nose.plugins.xunit.Xunit.configure method plugins/xunit.html
nose.plugins.manager.EntryPointPluginManager.loadPlugins method api/plugin_manager.html
nose.suite.MixedContextError exception api/suite.html
nose.tools.assert_equals attribute testing_tools.html
nose.tools.assert_false attribute testing_tools.html
nose.loader.TestLoader.getTestCaseNames method api/loader.html
nose.plugins.prof.Profile.begin method plugins/prof.html
nose.plugins.allmodules.AllModules.wantFile method plugins/allmodules.html
nose.importer.Importer.importFromPath method api/importer.html
nose.plugins.doctests.Doctest.options method plugins/doctests.html
nose.config.flag function api/config.html
nose.plugins.base.IPluginInterface.prepareTestResult method plugins/interface.html
nose.plugins.base.Plugin class plugins/interface.html
nose.plugins.testid.TestId.setOutputStream method plugins/testid.html
nose.tools.assert_equal attribute testing_tools.html
nose.util.cmp_lineno function api/util.html
nose.tools.eq_ function testing_tools.html
nose.failure.Failure class api/test_cases.html
nose.plugins.base.IPluginInterface.describeTest method plugins/interface.html
nose.tools.assert_true attribute testing_tools.html
nose.case.Test.run method api/test_cases.html
nose.plugins.base.Plugin.addOptions method plugins/interface.html
nose.plugins.debug.Pdb.addFailure method plugins/debug.html
nose.plugins.isolate.IsolationPlugin.loadTestsFromNames method plugins/isolate.html
nose.selector.Selector.wantFile method api/selector.html
nose.tools.assert_almost_equals attribute testing_tools.html
nose.plugins.isolate.IsolationPlugin.beforeContext method plugins/isolate.html
nose.plugins.base.IPluginInterface.stopTest method plugins/interface.html
nose.plugins.collect.CollectOnly.prepareTestCase method plugins/collect.html
nose.util.getfilename function api/util.html
nose.suite.ContextList class api/suite.html
nose.plugins.testid.TestId.configure method plugins/testid.html
nose.util.ln function api/util.html
nose.proxy.ResultProxy.shouldStop attribute api/proxy.html
nose.plugins.manager.PluginManager.proxyClass attribute api/plugin_manager.html
nose.plugins.plugintest.PluginTester.makeSuite method plugins/testing.html
nose.plugins.base.IPluginInterface.finalize method plugins/interface.html
nose.loader.TestLoader.resolve method api/loader.html
nose.plugins.base.IPluginInterface.formatFailure method plugins/interface.html
nose.util.split_test_name function api/util.html
nose.plugins.allmodules.AllModules.options method plugins/allmodules.html
nose.plugins.base.IPluginInterface.prepareTestLoader method plugins/interface.html
nose.loader.TestLoader.makeTest method api/loader.html
nose.plugins.collect.CollectOnly.prepareTestLoader method plugins/collect.html
nose.tools.assert_raises attribute testing_tools.html
nose.plugins.deprecated.Deprecated.options method plugins/deprecated.html
nose.plugins.prof.Profile.configure method plugins/prof.html
nose.plugins.deprecated.Deprecated.configure method plugins/deprecated.html
nose.plugins.base.IPluginInterface.loadTestsFromTestCase method plugins/interface.html
nose.tools.ok_ function testing_tools.html
nose.inspector.Expander class api/inspector.html
nose.plugins.xunit.Xunit.report method plugins/xunit.html
nose.plugins.base.IPluginInterface.prepareTest method plugins/interface.html
nose.plugins.base.IPluginInterface.loadTestsFromPath method plugins/interface.html
nose.plugins.manager.PluginManager.plugins attribute api/plugin_manager.html
nose.config.Config class api/config.html
nose.util.func_lineno function api/util.html
nose.plugins.base.IPluginInterface.beforeImport method plugins/interface.html
nose.case.Test.address method api/test_cases.html
nose.plugins.base.IPluginInterface.makeTest method plugins/interface.html
nose.config.Config.help method api/config.html
nose.plugins.base.IPluginInterface.stopContext method plugins/interface.html
nose.plugins.base.IPluginInterface.wantClass method plugins/interface.html
nose.plugins.cover.Coverage.options method plugins/cover.html
nose.tools.assert_not_almost_equal attribute testing_tools.html
nose.plugins.attrib.AttributeSelector class plugins/attrib.html
nose.plugins.cover.Coverage.configure method plugins/cover.html
nose.plugins.capture.Capture.formatFailure method plugins/capture.html
nose.config.Config.getParser method api/config.html
nose.loader.TestLoader.loadTestsFromGeneratorMethod method api/loader.html
nose.plugins.base.IPluginInterface.wantDirectory method plugins/interface.html
nose.plugins.base.Plugin.configure method plugins/interface.html
nose.plugins.testid.TestId.loadTestsFromNames method plugins/testid.html
nose.core.TestProgram class api/core.html
nose.plugins.attrib.AttributeSelector.wantFunction method plugins/attrib.html
nose.result.TextTestResult.wasSuccessful method api/result.html
nose.core.main attribute api/core.html
nose.case.Test class api/test_cases.html
nose.config.all_config_files function api/config.html
nose.plugins.base.IPluginInterface.prepareTestRunner method plugins/interface.html
nose.case.Test.id method api/test_cases.html
nose.core.TestProgram.showPlugins method api/core.html
nose.plugins.isolate.IsolationPlugin.configure method plugins/isolate.html
nose.plugins.attrib.AttributeSelector.configure method plugins/attrib.html
nose.selector.defaultSelector attribute api/selector.html
nose.plugins.base.IPluginInterface.addFailure method plugins/interface.html
nose.plugins.base.Plugin.help method plugins/interface.html
nose.plugins.logcapture.LogCapture class plugins/logcapture.html
nose.plugins.xunit.Xunit.addError method plugins/xunit.html
nose.selector.TestAddress class api/selector.html
nose.plugins.attrib.AttributeSelector.options method plugins/attrib.html
nose.plugins.xunit.Xunit.startTest method plugins/xunit.html
nose.tools.nottest function testing_tools.html
nose.plugins.doctests.Doctest class plugins/doctests.html
nose.plugins.doctests.Doctest.makeTest method plugins/doctests.html
nose.proxy.proxied_attribute function api/proxy.html
nose.plugins.doctests.Doctest.loadTestsFromModule method plugins/doctests.html
nose.twistedtools.deferred function api/twistedtools.html
nose.selector.Selector.wantModule method api/selector.html
nose.plugins.base.IPluginInterface.prepareTestCase method plugins/interface.html
nose.plugins.doctests.Doctest.suiteClass attribute plugins/doctests.html
nose.suite.ContextSuite.run method api/suite.html
nose.plugins.base.IPluginInterface.wantFunction method plugins/interface.html
nose.plugins.failuredetail.FailureDetail.configure method plugins/failuredetail.html
nose.loader.defaultTestLoader attribute api/loader.html
nose.plugins.isolate.IsolationPlugin.afterContext method plugins/isolate.html
nose.util.src function api/util.html
nose.case.Test.context attribute api/test_cases.html
nose.util.absdir function api/util.html
nose.plugins.base.IPluginInterface.handleFailure method plugins/interface.html
nose.util.tolist function api/util.html
nose.plugins.base.IPluginInterface.beforeContext method plugins/interface.html
nose.plugins.testid.TestId.finalize method plugins/testid.html
nose.plugins.base.IPluginInterface.addSuccess method plugins/interface.html
nose.util.isclass function api/util.html
nose.suite.ContextSuiteFactory.ancestry method api/suite.html
nose.tools.assert_not_almost_equals attribute testing_tools.html
nose.selector.Selector.wantDirectory method api/selector.html
nose.plugins.capture.Capture.formatError method plugins/capture.html
nose.plugins.isolate.IsolationPlugin class plugins/isolate.html
nose.plugins.failuredetail.FailureDetail.options method plugins/failuredetail.html
nose.tools.assert_not_equals attribute testing_tools.html
nose.plugins.debug.Pdb.options method plugins/debug.html
nose.plugins.prof.Profile.finalize method plugins/prof.html
nose.plugins.multiprocess.MultiProcess.configure method plugins/multiprocess.html
nose.config.Config.configureLogging method api/config.html
nose.tools.assert_not_equal attribute testing_tools.html
nose.tools.make_decorator function testing_tools.html
nose.plugins.testid.TestId.startTest method plugins/testid.html
nose.twistedtools.threaded_reactor function api/twistedtools.html
nose.plugins.base.IPluginInterface.afterImport method plugins/interface.html
nose.plugins.base.IPluginInterface.addDeprecated method plugins/interface.html
nose.plugins.base.IPluginInterface.wantFile method plugins/interface.html
nose.plugins.logcapture.LogCapture.options method plugins/logcapture.html
nose.plugins.multiprocess.MultiProcess.prepareTestRunner method plugins/multiprocess.html
nose.case.Test.beforeTest method api/test_cases.html
nose.selector.Selector.matches method api/selector.html
nose.plugins.logcapture.LogCapture.configure method plugins/logcapture.html
nose.plugins.testid.TestId class plugins/testid.html
nose.plugins.capture.Capture.configure method plugins/capture.html
nose.case.Test.afterTest method api/test_cases.html
nose.commands.get_user_options function api/commands.html
nose.core.TestProgram.createTests method api/core.html
nose.importer.add_path function api/importer.html
nose.selector.Selector class api/selector.html
nose.plugins.prof.Profile.options method plugins/prof.html
nose.plugins.doctests.Doctest.configure method plugins/doctests.html
nose.plugins.capture.Capture.finalize method plugins/capture.html
nose.result.TextTestResult.addError method api/result.html
nose.plugins.base.IPluginInterface.wantModuleTests method plugins/interface.html
nose.plugins.prof.Profile.prepareTest method plugins/prof.html
nose.plugins.base.IPluginInterface.report method plugins/interface.html
nose.plugins.xunit.Xunit.addSuccess method plugins/xunit.html
nose.util.resolve_name function api/util.html

Просмотреть файл

@ -204,7 +204,6 @@ intersphinx_mapping = {
'http://docs.djangoproject.com/en/dev': 'django.inv',
'http://jinja.pocoo.org/2/documentation/': 'jinja.inv',
'http://sphinx.pocoo.org/': 'jinja.inv',
'http://somethingaboutorange.com/mrl/projects/nose/0.11.1/': 'nose.inv',
}
for key, val in intersphinx_mapping.items():

Просмотреть файл

@ -107,23 +107,30 @@ you suck. See the git-bisect man page for more details.
Running Tests
~~~~~~~~~~~~~
* Run your tests like this::
Run your tests like this::
python manage.py test --noinput --logging-clear-handlers
* ``--noinput`` tells Django not to ask about creating or destroying test
databases.
* ``--logging-clear-handlers`` tells nose that you don't want to see any
logging output. Without this, our debug logging will spew all over your
console during test runs. This can be useful for debugging, but it's not that
great most of the time. See the docs for more stuff you can do with
:mod:`nose and logging <nose.plugins.logcapture>`.
py.test
There's also a few useful makefile targets like ``test``, ``tdd`` and
``test_force_db``::
make test
If you want to only run a few tests, you can specify which ones using different
methods:
* `py.test -m es_tests` to run the tests that are marked_ as `es_tests`
* `py.test -k test_no_license` to run all the tests that have
`test_no_license` in their name
* `py.test apps/addons/tests/test_views.py::TestLicensePage::test_no_license`
to run only this specific test
You'll find more documentation on this on the `Pytest usage documentation`_.
.. _marked: http://pytest.org/latest/mark.html
.. _Pytest usage documentation:
http://pytest.org/latest/usage.html#specifying-tests-selecting-tests
Building Docs
~~~~~~~~~~~~~

Просмотреть файл

@ -138,7 +138,7 @@ need to recompile the .mo files manually, for example::
.. _`Django's Unit Testing`: http://docs.djangoproject.com/en/dev/topics/testing
.. _`pytest`: http://pytest.org/latest/
.. _`pytest-django`: https://nose.readthedocs.org/en/latest/
.. _`pytest-django`: https://pytest-django.readthedocs.org/en/latest/
.. _`Selenium`: http://www.seleniumhq.org/
.. _`Selenium repository`: https://github.com/mozilla/Addon-Tests/
.. _mock: http://pypi.python.org/pypi/mock

Просмотреть файл

@ -1 +0,0 @@
"""This is here so nose coverage considers these packages part of zamboni."""

Просмотреть файл

@ -397,7 +397,6 @@ INSTALLED_APPS = (
# Third party apps
'django_extensions',
'django_nose',
'gunicorn',
'raven.contrib.django',
'piston',
@ -422,12 +421,6 @@ TEST_INSTALLED_APPS = (
'translations.tests.testapp',
)
# Tests
TEST_RUNNER = 'amo.runner.TestRunner'
NOSE_ARGS = [
'--with-fixture-bundling',
]
# Tells the extract script what files to look for l10n in and what function
# handles the extraction. The Tower library expects this.
DOMAIN_METHODS = {
@ -1095,7 +1088,6 @@ LOGGING = {
'z.es': {'level': logging.INFO},
'z.heka': {'level': logging.INFO},
's.client': {'level': logging.INFO},
'nose': {'level': logging.WARNING},
},
}

Просмотреть файл

@ -29,7 +29,6 @@ django-filter==0.7
django-memcached-pool==0.4.1
django-multidb-router==0.5.1
django-mysql-pymysql==0.1
django-nose==1.2
django-quieter-formset==0.4
django-pymemcache==0.1.1-fixserial
django-raven-heka==0.3

Просмотреть файл

@ -3,7 +3,6 @@
-r prod.txt
execnet==1.2
nose-blockage==0.1.2
psutil==0.2.0
py==1.4.26
pytest==2.6.4