##// END OF EJS Templates
nbconvert requires mistune...
nbconvert requires mistune You get a cryptic error message from iptest if mistune is not installed. Test group: nbconvert E ====================================================================== ERROR: Failure: AttributeError ('module' object has no attribute 'nbconvert') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 403, in loadTestsFromName module = resolve_name(addr.module) File "/usr/lib/python2.7/dist-packages/nose/util.py", line 321, in resolve_name obj = getattr(obj, part) AttributeError: 'module' object has no attribute 'nbconvert' ---------------------------------------------------------------------- Ran 1 test in 0.001s FAILED (errors=1

File last commit:

r12781:1411cb6d
r17585:fcfb06b0
Show More
base.py
42 lines | 1.3 KiB | text/x-python | PythonLexer
"""
Contains base test class for nbformat
"""
#-----------------------------------------------------------------------------
#Copyright (c) 2013, the IPython Development Team.
#
#Distributed under the terms of the Modified BSD License.
#
#The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import os
import unittest
import IPython
#-----------------------------------------------------------------------------
# Classes and functions
#-----------------------------------------------------------------------------
class TestsBase(unittest.TestCase):
"""Base tests class."""
def fopen(self, f, mode=u'r'):
return open(os.path.join(self._get_files_path(), f), mode)
def _get_files_path(self):
#Get the relative path to this module in the IPython directory.
names = self.__module__.split(u'.')[1:-1]
#Build a path using the IPython directory and the relative path we just
#found.
path = IPython.__path__[0]
for name in names:
path = os.path.join(path, name)
return path