Skip to content

Commit eea5922

Browse files
committed
-
1 parent ccfeb19 commit eea5922

File tree

9 files changed

+16
-25
lines changed

9 files changed

+16
-25
lines changed

tests/app/config_paths_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def voila_config_file_paths_arg():
1313
return '--Voila.config_file_paths=[%r]' % path
1414

1515

16-
def test_config_app(voila_app, get_test_template):
16+
def test_config_app(voila_app):
1717
assert voila_app.template == 'test_template'
1818
assert voila_app.enable_nbextensions is True
1919

@@ -26,7 +26,7 @@ def test_config_contents_manager(voila_app):
2626
assert voila_app.serverapp.contents_manager.use_atomic_writing is False
2727

2828

29-
async def test_template(get_test_template, fetch):
29+
async def test_template(fetch):
3030
response = await fetch('voila', method='GET')
3131
assert response.code == 200
3232
assert 'test_template.css' in response.body.decode('utf-8')

tests/app/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def voila_args(voila_notebook, voila_args_extra, voila_config_file_paths_arg):
3535

3636

3737
@pytest.fixture(autouse=True)
38-
def voila_app(server_config, voila_config, voila_args, get_nbconvert_template):
38+
def voila_app(server_config, voila_config, voila_args):
3939
# Get an instance of Voila
4040
voila_app = Voila(**voila_config)
4141
# Get an instance of the underlying server. This is

tests/app/execute_cpp_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def voila_args(notebook_directory, voila_args_extra):
1515

1616

1717
@pytest.mark.skipif(not TEST_XEUS_CLING, reason='opt in to avoid having to install xeus-cling')
18-
async def test_cpp11_kernel(fetch, get_jupyter_kernels):
18+
async def test_cpp11_kernel(fetch):
1919
response = await fetch('voila', 'render', 'print.xcpp', method='GET')
2020
assert response.code == 200
2121
assert 'Hello voila, from c++' in response.body.decode('utf-8')

tests/app/nbextensions_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def voila_config_file_paths_arg():
2020
return '--Voila.config_file_paths=[%r]' % path
2121

2222

23-
async def test_lists_extension(get_test_template, get_nbextensions, fetch):
23+
async def test_lists_extension(fetch):
2424
response = await fetch('voila', method='GET')
2525
assert response.code == 200
2626
html_text = response.body.decode('utf-8')

tests/app/serve_directory_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def test_print_py(fetch):
2828

2929

3030
@pytest.mark.skipif(not TEST_XEUS_CLING, reason='opt in to avoid having to install xeus-cling')
31-
async def test_print_cpp_notebook(fetch, get_jupyter_kernels):
31+
async def test_print_cpp_notebook(fetch):
3232
response = await fetch('voila', 'render', 'print_cpp.ipynb', method='GET')
3333
assert response.code == 200
3434
assert 'Hi Voila, from c++' in response.body.decode('utf-8')

tests/app/template_arg_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def voila_args_extra():
77
return ['--Voila.template=test_template']
88

99

10-
async def test_template(get_test_template, fetch):
10+
async def test_template(fetch):
1111
response = await fetch('voila', method='GET')
1212
assert response.code == 200
1313
assert 'test_template.css' in response.body.decode('utf-8')

tests/app/template_config_file_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def voila_args_extra():
1414
return ['--Voila.template=test_template', '--Voila.nbconvert_template_paths=[%r, %r]' % (path_test_template, path_default), '--ServerApp.config_file=%r' % path_config]
1515

1616

17-
async def test_template_test(get_test_template, fetch):
17+
async def test_template_test(fetch):
1818
response = await fetch('voila', method='GET')
1919
assert response.code == 200
2020
assert 'test_template.css' in response.body.decode('utf-8')

tests/app/template_custom_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def voila_config():
2323
return config
2424

2525

26-
async def test_template(get_test_template, voila_config, voila_app, fetch):
26+
async def test_template(voila_config, voila_app, fetch):
2727
response = await fetch('voila', method='GET')
2828
assert response.code == 200
2929
assert 'test_template.css' in response.body.decode('utf-8')

tests/conftest.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,28 @@ def voila_notebook(notebook_directory):
2323
return os.path.join(notebook_directory, 'print.ipynb')
2424

2525

26-
@pytest.fixture
26+
@pytest.fixture(autouse=1)
2727
def get_jupyter_kernels(env_jupyter_path):
2828
src = sys.prefix + '/share/jupyter/kernels'
2929
dst = str(env_jupyter_path) + '/kernels'
3030
shutil.copytree(src, dst)
3131

3232

33-
@pytest.fixture
34-
def get_nbconvert_template(env_jupyter_path):
33+
@pytest.fixture(autouse=1)
34+
def get_nbconvert_templates(env_jupyter_path):
3535
src = sys.prefix + '/share/jupyter/nbconvert'
3636
dst = str(env_jupyter_path) + '/nbconvert'
3737
shutil.copytree(src, dst)
3838

3939

40-
@pytest.fixture
41-
def get_jupyter_config(environ):
42-
dir_path = os.path.dirname(os.path.realpath(__file__))
43-
src = f'{dir_path}/../etc/jupyter/jupyter_server_config.d/voila.json'
44-
dst = os.environ['JUPYTER_CONFIG_DIR']
45-
shutil.copyfile(src, dst)
46-
47-
48-
@pytest.fixture
49-
def get_test_template(env_jupyter_path):
50-
dir_path = os.path.dirname(os.path.realpath(__file__))
51-
src = f'{dir_path}/test_template/share/jupyter/voila'
40+
@pytest.fixture(autouse=1)
41+
def get_voila_templates(env_jupyter_path):
42+
src = sys.prefix + '/share/jupyter/voila'
5243
dst = str(env_jupyter_path) + '/voila'
5344
shutil.copytree(src, dst)
5445

5546

56-
@pytest.fixture
47+
@pytest.fixture(autouse=1)
5748
def get_nbextensions(env_jupyter_path):
5849
src = sys.prefix + '/share/jupyter/nbextensions'
5950
dst = str(env_jupyter_path) + '/nbextensions'

0 commit comments

Comments
 (0)