diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3e29a164..bfaa9781 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,7 +46,7 @@ jobs: - name: Run tests run: | - python -m pytest -vs nglview/tests --cov=nglview --cov-report=html --disable-pytest-warnings + python -m pytest -vs tests --cov=nglview --cov-report=html --disable-pytest-warnings - name: Check installation with pip run: | diff --git a/nglview/tests/.coveragerc b/tests/.coveragerc similarity index 100% rename from nglview/tests/.coveragerc rename to tests/.coveragerc diff --git a/nglview/tests/data/rho.pdb b/tests/data/rho.pdb similarity index 100% rename from nglview/tests/data/rho.pdb rename to tests/data/rho.pdb diff --git a/nglview/tests/data/tc5b.parm b/tests/data/tc5b.parm similarity index 100% rename from nglview/tests/data/tc5b.parm rename to tests/data/tc5b.parm diff --git a/nglview/tests/data/tc5b.ref.crd b/tests/data/tc5b.ref.crd similarity index 100% rename from nglview/tests/data/tc5b.ref.crd rename to tests/data/tc5b.ref.crd diff --git a/nglview/tests/data/tc5b.x b/tests/data/tc5b.x similarity index 100% rename from nglview/tests/data/tc5b.x rename to tests/data/tc5b.x diff --git a/nglview/tests/data/tz2.pdb b/tests/data/tz2.pdb similarity index 100% rename from nglview/tests/data/tz2.pdb rename to tests/data/tz2.pdb diff --git a/nglview/tests/data/tz2.single.pdb b/tests/data/tz2.single.pdb similarity index 100% rename from nglview/tests/data/tz2.single.pdb rename to tests/data/tz2.single.pdb diff --git a/nglview/tests/data/tz2_2.pdb.gz b/tests/data/tz2_2.pdb.gz similarity index 100% rename from nglview/tests/data/tz2_2.pdb.gz rename to tests/data/tz2_2.pdb.gz diff --git a/nglview/tests/data/volmap.dx b/tests/data/volmap.dx similarity index 100% rename from nglview/tests/data/volmap.dx rename to tests/data/volmap.dx diff --git a/nglview/tests/js/test.js b/tests/js/test.js similarity index 100% rename from nglview/tests/js/test.js rename to tests/js/test.js diff --git a/nglview/tests/make_dummy_comm.py b/tests/make_dummy_comm.py similarity index 100% rename from nglview/tests/make_dummy_comm.py rename to tests/make_dummy_comm.py diff --git a/nglview/tests/notebooks/README.md b/tests/notebooks/README.md similarity index 100% rename from nglview/tests/notebooks/README.md rename to tests/notebooks/README.md diff --git a/nglview/tests/notebooks/api/test_add_shape.ipynb b/tests/notebooks/api/test_add_shape.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_add_shape.ipynb rename to tests/notebooks/api/test_add_shape.ipynb diff --git a/nglview/tests/notebooks/api/test_app_layout.ipynb b/tests/notebooks/api/test_app_layout.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_app_layout.ipynb rename to tests/notebooks/api/test_app_layout.ipynb diff --git a/nglview/tests/notebooks/api/test_custom_color.ipynb b/tests/notebooks/api/test_custom_color.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_custom_color.ipynb rename to tests/notebooks/api/test_custom_color.ipynb diff --git a/nglview/tests/notebooks/api/test_embed.ipynb b/tests/notebooks/api/test_embed.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_embed.ipynb rename to tests/notebooks/api/test_embed.ipynb diff --git a/nglview/tests/notebooks/api/test_grid_view_sync_camera.ipynb b/tests/notebooks/api/test_grid_view_sync_camera.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_grid_view_sync_camera.ipynb rename to tests/notebooks/api/test_grid_view_sync_camera.ipynb diff --git a/nglview/tests/notebooks/api/test_gui_theme.ipynb b/tests/notebooks/api/test_gui_theme.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_gui_theme.ipynb rename to tests/notebooks/api/test_gui_theme.ipynb diff --git a/nglview/tests/notebooks/api/test_movie_making.ipynb b/tests/notebooks/api/test_movie_making.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_movie_making.ipynb rename to tests/notebooks/api/test_movie_making.ipynb diff --git a/nglview/tests/notebooks/api/test_render_image.ipynb b/tests/notebooks/api/test_render_image.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_render_image.ipynb rename to tests/notebooks/api/test_render_image.ipynb diff --git a/nglview/tests/notebooks/api/test_representations.ipynb b/tests/notebooks/api/test_representations.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_representations.ipynb rename to tests/notebooks/api/test_representations.ipynb diff --git a/nglview/tests/notebooks/api/test_set_coordinates.ipynb b/tests/notebooks/api/test_set_coordinates.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_set_coordinates.ipynb rename to tests/notebooks/api/test_set_coordinates.ipynb diff --git a/nglview/tests/notebooks/api/test_sync_view.ipynb b/tests/notebooks/api/test_sync_view.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_sync_view.ipynb rename to tests/notebooks/api/test_sync_view.ipynb diff --git a/nglview/tests/notebooks/api/test_view_trajectory.ipynb b/tests/notebooks/api/test_view_trajectory.ipynb similarity index 100% rename from nglview/tests/notebooks/api/test_view_trajectory.ipynb rename to tests/notebooks/api/test_view_trajectory.ipynb diff --git a/nglview/tests/notebooks/extra/README.md b/tests/notebooks/extra/README.md similarity index 100% rename from nglview/tests/notebooks/extra/README.md rename to tests/notebooks/extra/README.md diff --git a/nglview/tests/notebooks/extra/component_viewer.ipynb b/tests/notebooks/extra/component_viewer.ipynb similarity index 100% rename from nglview/tests/notebooks/extra/component_viewer.ipynb rename to tests/notebooks/extra/component_viewer.ipynb diff --git a/nglview/tests/notebooks/extra/display_some_components.ipynb b/tests/notebooks/extra/display_some_components.ipynb similarity index 100% rename from nglview/tests/notebooks/extra/display_some_components.ipynb rename to tests/notebooks/extra/display_some_components.ipynb diff --git a/nglview/tests/notebooks/extra/example_mbuild.ipynb b/tests/notebooks/extra/example_mbuild.ipynb similarity index 100% rename from nglview/tests/notebooks/extra/example_mbuild.ipynb rename to tests/notebooks/extra/example_mbuild.ipynb diff --git a/nglview/tests/notebooks/extra/movie_making.ipynb b/tests/notebooks/extra/movie_making.ipynb similarity index 100% rename from nglview/tests/notebooks/extra/movie_making.ipynb rename to tests/notebooks/extra/movie_making.ipynb diff --git a/nglview/tests/notebooks/extra/test_component_names.ipynb b/tests/notebooks/extra/test_component_names.ipynb similarity index 100% rename from nglview/tests/notebooks/extra/test_component_names.ipynb rename to tests/notebooks/extra/test_component_names.ipynb diff --git a/nglview/tests/notebooks/extra/test_grid_box_3_views_with_gui.ipynb b/tests/notebooks/extra/test_grid_box_3_views_with_gui.ipynb similarity index 100% rename from nglview/tests/notebooks/extra/test_grid_box_3_views_with_gui.ipynb rename to tests/notebooks/extra/test_grid_box_3_views_with_gui.ipynb diff --git a/nglview/tests/notebooks/extra/test_sync_camera.ipynb b/tests/notebooks/extra/test_sync_camera.ipynb similarity index 100% rename from nglview/tests/notebooks/extra/test_sync_camera.ipynb rename to tests/notebooks/extra/test_sync_camera.ipynb diff --git a/nglview/tests/test_color.py b/tests/test_color.py similarity index 100% rename from nglview/tests/test_color.py rename to tests/test_color.py diff --git a/nglview/tests/test_component_viewer.py b/tests/test_component_viewer.py similarity index 100% rename from nglview/tests/test_component_viewer.py rename to tests/test_component_viewer.py diff --git a/nglview/tests/test_movie_maker.py b/tests/test_movie_maker.py similarity index 100% rename from nglview/tests/test_movie_maker.py rename to tests/test_movie_maker.py diff --git a/nglview/tests/test_show.py b/tests/test_show.py similarity index 100% rename from nglview/tests/test_show.py rename to tests/test_show.py diff --git a/nglview/tests/test_theme.py b/tests/test_theme.py similarity index 100% rename from nglview/tests/test_theme.py rename to tests/test_theme.py diff --git a/nglview/tests/test_utils.py b/tests/test_utils.py similarity index 100% rename from nglview/tests/test_utils.py rename to tests/test_utils.py diff --git a/nglview/tests/test_version.py b/tests/test_version.py similarity index 62% rename from nglview/tests/test_version.py rename to tests/test_version.py index aa9f4a76..0f2634fa 100644 --- a/nglview/tests/test_version.py +++ b/tests/test_version.py @@ -1,15 +1,15 @@ import json -import os +from pathlib import Path import nglview as nv def test_make_sure_versions_matched(): - nglview_dir = os.path.join(os.path.dirname(__file__), '..') + nglview_dir = Path(__file__).resolve().parent.parent / 'nglview' # frontend and backend - nglview_js_widgets = os.path.join(nglview_dir, 'static', 'index.js') - with open(nglview_js_widgets) as fh: + nglview_js_widgets = nglview_dir / 'static' / 'index.js' + with nglview_js_widgets.open() as fh: for line in fh: if '"name":"nglview-js-widgets"' in line: break diff --git a/nglview/tests/test_widget.py b/tests/test_widget.py similarity index 100% rename from nglview/tests/test_widget.py rename to tests/test_widget.py diff --git a/nglview/tests/utils.py b/tests/utils.py similarity index 100% rename from nglview/tests/utils.py rename to tests/utils.py