diff --git a/IPython/nbformat/v3/tests/formattest.py b/IPython/nbformat/v3/tests/formattest.py index 1b6088c..d19725c 100644 --- a/IPython/nbformat/v3/tests/formattest.py +++ b/IPython/nbformat/v3/tests/formattest.py @@ -6,8 +6,6 @@ import tempfile pjoin = os.path.join -from unittest import TestCase - from ..nbbase import ( NotebookNode, new_code_cell, new_text_cell, new_worksheet, new_notebook @@ -20,7 +18,8 @@ from .nbexamples import nb0, nb0_py def open_utf8(fname, mode): return io.open(fname, mode=mode, encoding='utf-8') -class NBFormatTestCase(TestCase): +class NBFormatTest: + """Mixin for writing notebook format tests""" # override with appropriate values in subclasses nb0_ref = None @@ -61,4 +60,4 @@ class NBFormatTestCase(TestCase): nb = self.mod.read(f) - + diff --git a/IPython/nbformat/v3/tests/test_json.py b/IPython/nbformat/v3/tests/test_json.py index 5b7d6f8..bd5f8a5 100644 --- a/IPython/nbformat/v3/tests/test_json.py +++ b/IPython/nbformat/v3/tests/test_json.py @@ -10,7 +10,7 @@ from . import formattest from .nbexamples import nb0 -class TestJSON(formattest.NBFormatTestCase): +class TestJSON(formattest.NBFormatTest, TestCase): nb0_ref = None ext = 'ipynb' diff --git a/IPython/nbformat/v3/tests/test_nbpy.py b/IPython/nbformat/v3/tests/test_nbpy.py index 1b70d1d..858a6b7 100644 --- a/IPython/nbformat/v3/tests/test_nbpy.py +++ b/IPython/nbformat/v3/tests/test_nbpy.py @@ -1,11 +1,14 @@ # -*- coding: utf8 -*- + +from unittest import TestCase + from . import formattest from .. import nbpy from .nbexamples import nb0, nb0_py -class TestPy(formattest.NBFormatTestCase): +class TestPy(formattest.NBFormatTest, TestCase): nb0_ref = nb0_py ext = 'py'