Skip to content

Commit

Permalink
move autotests file
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorcampbell committed Aug 31, 2023
1 parent ec86a9a commit 95174e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nbgrader/tests/preprocessors/test_instantiatetests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import shutil
import os
from textwrap import dedent
from ...preprocessors import InstantiateTests
Expand Down Expand Up @@ -118,8 +119,15 @@ def test_kernel_workingdir(self, preprocessor, caplog):
resources = {
'metadata': {'path': 'nbgrader/docs/source/user_guide/source/'}
}
# make sure autotest doesn't fail prior to running the
# preprocessor because it can't find autotests.yml
# we want it to fail because it can't find a resource file
shutil.copyfile('autotests.yml', 'source/autotests.yml')
with pytest.raises(Exception):
nb, resources = preprocessor.preprocess(nb, resources)
# remove the temporary resource
os.remove('source/autotests.yml')

assert "FileNotFoundError" in caplog.text

# test that a warning is thrown when we set enforce_metadata = False and have an AUTOTEST directive in a
Expand Down

0 comments on commit 95174e9

Please sign in to comment.