1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
"""
Contains base test class for nbformat
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
import os
import unittest
class TestsBase(unittest.TestCase):
"""Base tests class."""
@classmethod
def fopen(cls, f, mode="r", encoding="utf-8"):
return open(os.path.join(cls._get_files_path(), f), mode, encoding=encoding) # noqa
@classmethod
def _get_files_path(cls):
return os.path.dirname(__file__)
|