summaryrefslogtreecommitdiffstats
path: root/tests/test_compile_markdown.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_compile_markdown.py')
-rw-r--r--tests/test_compile_markdown.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/test_compile_markdown.py b/tests/test_compile_markdown.py
index ace17cf..47cbdbb 100644
--- a/tests/test_compile_markdown.py
+++ b/tests/test_compile_markdown.py
@@ -1,14 +1,11 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
-# 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
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
-import codecs
+import io
import shutil
import tempfile
import unittest
@@ -28,13 +25,13 @@ class CompileMarkdownTests(BaseTestCase):
self.compiler.set_site(FakeSite())
def compile(self, input_string):
- with codecs.open(self.input_path, "w+", "utf8") as input_file:
+ with io.open(self.input_path, "w+", encoding="utf8") as input_file:
input_file.write(input_string)
self.compiler.compile_html(self.input_path, self.output_path)
output_str = None
- with codecs.open(self.output_path, "r", "utf8") as output_path:
+ with io.open(self.output_path, "r", encoding="utf8") as output_path:
output_str = output_path.read()
return output_str