Skip to content

Commit

Permalink
Verify all tmp files removed after pdf gen
Browse files Browse the repository at this point in the history
  • Loading branch information
saulshanabrook committed Feb 27, 2018
1 parent 6bdba4f commit 2210f10
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nbconvert/exporters/tests/test_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def test_constructor(self):
def test_export(self):
"""Smoke test PDFExporter"""
with tempdir.TemporaryDirectory() as td:
newpath = os.path.join(td, os.path.basename(self._get_notebook()))
file_name = os.path.basename(self._get_notebook())
newpath = os.path.join(td, file_name)
shutil.copy(self._get_notebook(), newpath)
(output, resources) = self.exporter_class(latex_count=1).from_filename(newpath)
self.assertIsInstance(output, bytes)
assert len(output) > 0
# tex file should be cleaned up
assert 'notebook.tex' not in os.listdir(td)

# all temporary file should be cleaned up
assert {file_name} == set(os.listdir(td))

0 comments on commit 2210f10

Please sign in to comment.