Skip to content

Commit

Permalink
Merge pull request #79 from michaelpacer/add_encoding_to_test_open
Browse files Browse the repository at this point in the history
add encoding to tests base class fopen function
  • Loading branch information
minrk committed Feb 8, 2017
2 parents c9be78a + c49fad7 commit 1b4f8cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nbformat/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

import os
import unittest

import io

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 fopen(self, f, mode=u'r',encoding='utf-8'):
return io.open(os.path.join(self._get_files_path(), f), mode, encoding=encoding)


def _get_files_path(self):
Expand Down

0 comments on commit 1b4f8cd

Please sign in to comment.