aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_rst_compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_rst_compiler.py')
-rw-r--r--tests/test_rst_compiler.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/test_rst_compiler.py b/tests/test_rst_compiler.py
index 379aba2..1747332 100644
--- a/tests/test_rst_compiler.py
+++ b/tests/test_rst_compiler.py
@@ -27,14 +27,11 @@ always unquoted.
from __future__ import unicode_literals, absolute_import
-# 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
try:
from io import StringIO
except ImportError:
@@ -76,15 +73,15 @@ class ReSTExtensionTestCase(BaseTestCase):
inf = os.path.join(tmpdir, 'inf')
outf = os.path.join(tmpdir, 'outf')
depf = os.path.join(tmpdir, 'outf.dep')
- with codecs.open(inf, 'wb+', 'utf8') as f:
+ with io.open(inf, 'w+', encoding='utf8') as f:
f.write(rst)
self.html = self.compiler.compile_html(inf, outf)
- with codecs.open(outf, 'r', 'utf8') as f:
+ with io.open(outf, 'r', encoding='utf8') as f:
self.html = f.read()
os.unlink(inf)
os.unlink(outf)
if os.path.isfile(depf):
- with codecs.open(depf, 'r', 'utf8') as f:
+ with io.open(depf, 'r', encoding='utf8') as f:
self.assertEqual(self.deps, f.read())
os.unlink(depf)
else: