diff --git a/run_checks.sh b/run_checks.sh index 66c9288..8340e37 100755 --- a/run_checks.sh +++ b/run_checks.sh @@ -54,6 +54,6 @@ fi version="3.9" cd docs pip install sphinx furo autodocsumm sphinx_multiversion -sphinx_multiversion html . _build/html +sphinx-multiversion html . _build/html diff --git a/tests/test_logger.py b/tests/test_logger.py index bf43aec..4865d7d 100644 --- a/tests/test_logger.py +++ b/tests/test_logger.py @@ -9,8 +9,10 @@ def _delete_directory(log_dir): import shutil import os if os.path.exists(log_dir): - shutil.rmtree(log_dir) - + try: + shutil.rmtree(log_dir) + except: + pass @pytest.fixture def logger(): @@ -25,6 +27,8 @@ def logger(): logger = Logger(log_dir) yield logger + _delete_directory(log_dir) + def test_Logger(logger): # Create a logger object to log the results of the experiment assert logger.log_id == 1 diff --git a/tests/test_tutorial.py b/tests/test_tutorial.py index fbf0547..3251627 100644 --- a/tests/test_tutorial.py +++ b/tests/test_tutorial.py @@ -54,26 +54,3 @@ def test_mlxpsub_launching(script): ignore = "Use of uninitialized value" in error or "mlxp.errors.JobSubmissionError" in error if not ignore: assert not error - - - - -scripts = pathlib.Path(tutorial_path).resolve().glob('read_script.sh') - -@pytest.mark.parametrize('script', scripts) -def test_reading(script): - - parent_path = str(script.parent) - sys.path.insert(0,parent_path) - - with open(script, 'r') as file: - script_code = file.read() - rc = subprocess.call([f"cd {tutorial_path}\n"+script_code] , shell=True) - - try: - shutil.rmtree(os.path.join(tutorial_path,'logs')) - except: - pass - - assert rc==0 - \ No newline at end of file diff --git a/tutorial/launch_script.sh b/tutorial/launch_script.sh index 8e48aa9..9c50143 100755 --- a/tutorial/launch_script.sh +++ b/tutorial/launch_script.sh @@ -9,4 +9,9 @@ python main.py model.num_units=2,3,4 optimizer.lr=10.,1. seed=1,2,3\ - +mlxp.use_version_manager=False +mlxp.interactive_mode=False \ No newline at end of file + +mlxp.use_version_manager=False +mlxp.interactive_mode=False + +sleep 10 + + +python read.py \ No newline at end of file diff --git a/tutorial/mlxpsub_launch_script.sh b/tutorial/mlxpsub_launch_script.sh index 150ed88..1e87531 100755 --- a/tutorial/mlxpsub_launch_script.sh +++ b/tutorial/mlxpsub_launch_script.sh @@ -3,6 +3,3 @@ chmod u+x launch_script.sh mlxpsub launch_script.sh - - -sleep 10 \ No newline at end of file diff --git a/tutorial/read_script.sh b/tutorial/read_script.sh deleted file mode 100644 index a5961b3..0000000 --- a/tutorial/read_script.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - - -python read.py \ No newline at end of file