Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix tests
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Aug 21, 2015
1 parent de2a602 commit 63ac9a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
17 changes: 6 additions & 11 deletions tests/base.py
Expand Up @@ -9,12 +9,9 @@
__all__ = ["BaseTestCase", "cd", "LocaleSupportInTesting"]


# This code is so you can run the samples without installing the package,
# and should be before any import touching nikola, in any file under tests/
import os
import sys
extra_v6_plugin_dir = os.path.join(os.path.dirname(__file__), '..', 'v6')
sys.path.insert(0, extra_v6_plugin_dir)


from contextlib import contextmanager
import locale
Expand Down Expand Up @@ -204,11 +201,10 @@ def __init__(self):
self.config = {
'DISABLED_PLUGINS': [],
'EXTRA_PLUGINS': [],
'EXTRA_PLUGINS_DIRS': [extra_v6_plugin_dir],
'DEFAULT_LANG': 'en',
'MARKDOWN_EXTENSIONS': ['fenced_code', 'codehilite'],
'TRANSLATIONS_PATTERN': '{path}.{lang}.{ext}',
'LISTINGS_FOLDERS': {},
'LISTINGS_FOLDERS': {'listings': 'listings'},
}
self.EXTRA_PLUGINS = self.config['EXTRA_PLUGINS']
self.plugin_manager = PluginManager(categories_filter={
Expand All @@ -219,20 +215,19 @@ def __init__(self):
"PageCompiler": PageCompiler,
"TaskMultiplier": TaskMultiplier,
"CompilerExtension": CompilerExtension,
"RestExtension": RestExtension,
"MarkdownExtension": MarkdownExtension,
"RestExtension": RestExtension
})
self.loghandlers = [nikola.utils.STDERR_HANDLER]
self.loghandlers = nikola.utils.STDERR_HANDLER # TODO remove on v8
self.plugin_manager.setPluginInfoExtension('plugin')
extra_plugins_dirs = self.config['EXTRA_PLUGINS_DIRS']
if sys.version_info[0] == 3:
places = [
os.path.join(os.path.dirname(nikola.utils.__file__), 'plugins'),
] + [path for path in extra_plugins_dirs if path]
]
else:
places = [
os.path.join(os.path.dirname(nikola.utils.__file__), nikola.utils.sys_encode('plugins')),
] + [nikola.utils.sys_encode(path) for path in extra_plugins_dirs if path]
]
self.plugin_manager.setPluginPlaces(places)
self.plugin_manager.collectPlugins()
self.compiler_extensions = self._activate_plugins_of_category("CompilerExtension")
Expand Down
1 change: 1 addition & 0 deletions tests/test_command_tags.py
Expand Up @@ -60,6 +60,7 @@ def _init_site(self):
sys.path.pop(0)

self._site = nikola.Nikola(**conf.__dict__)
self._site.init_plugins()

def _parse_new_tags(self, source):
""" Returns the new tags for a post, given it's source path. """
Expand Down

0 comments on commit 63ac9a4

Please sign in to comment.