diff --git a/.coveragerc b/.coveragerc index 24657bf..8d7dd2a 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,7 +1,3 @@ -[run] -omit = - */tests/* - [report] exclude_lines = if __name__ == "__main__": diff --git a/CHANGELOG.md b/CHANGELOG.md index c00f53b..f7f1980 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention. +## [3.0.6] - 07-10-2024 + +### Changed + +- Moved tests back out of the package + ## [3.0.5] - 07-9-2024 ### Added @@ -120,6 +126,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and - switched to `pathlib` for file path parsing +[3.0.6]: https://github.com/A-Baji/discordAI-modelizer/compare/3.0.5...3.0.6 [3.0.5]: https://github.com/A-Baji/discordAI-modelizer/compare/3.0.4...3.0.5 [3.0.4]: https://github.com/A-Baji/discordAI-modelizer/compare/3.0.3...3.0.4 [3.0.3]: https://github.com/A-Baji/discordAI-modelizer/compare/3.0.2...3.0.3 diff --git a/discordai_modelizer/version.py b/discordai_modelizer/version.py index e94f36f..6ed0182 100644 --- a/discordai_modelizer/version.py +++ b/discordai_modelizer/version.py @@ -1 +1 @@ -__version__ = "3.0.5" +__version__ = "3.0.6" diff --git a/docker-compose-test.yaml b/docker-compose-test.yaml index 8093804..48de21b 100644 --- a/docker-compose-test.yaml +++ b/docker-compose-test.yaml @@ -18,12 +18,12 @@ services: env_file: .env.test volumes: - ./discordai_modelizer:/usr/local/lib/python${PY_VER}/site-packages/discordai_modelizer - - ./discordai_modelizer/tests:/main/tests + - ./tests:/main/tests - .coveragerc:/main/.coveragerc command: - sh - -c - | pip install pytest pytest-cov pytest-console-scripts --root-user-action ignore - pytest --cov-report term-missing --cov=discordai --cov-config=.coveragerc tests + pytest --cov-report term-missing --cov=discordai_modelizer --cov-config=.coveragerc tests # tail -f /dev/null \ No newline at end of file diff --git a/discordai_modelizer/tests/__init__.py b/tests/__init__.py similarity index 100% rename from discordai_modelizer/tests/__init__.py rename to tests/__init__.py diff --git a/discordai_modelizer/tests/conftest.py b/tests/conftest.py similarity index 100% rename from discordai_modelizer/tests/conftest.py rename to tests/conftest.py diff --git a/discordai_modelizer/tests/expected_values.py b/tests/expected_values.py similarity index 100% rename from discordai_modelizer/tests/expected_values.py rename to tests/expected_values.py diff --git a/discordai_modelizer/tests/test_command_line.py b/tests/test_command_line.py similarity index 62% rename from discordai_modelizer/tests/test_command_line.py rename to tests/test_command_line.py index 8d9c206..02f151f 100644 --- a/discordai_modelizer/tests/test_command_line.py +++ b/tests/test_command_line.py @@ -27,19 +27,17 @@ def test_cli_help(script_runner): assert "-V, --version show program's version number and exit" in cli.stdout -@mark.parametrize("command", ["discordai_modelizer"]) -def test_cli_model_list(script_runner, command): - cli = script_runner.run([command, "model", "list"]) +def test_cli_model_list(script_runner): + cli = script_runner.run(["discordai_modelizer", "model", "list"]) assert cli.success for o in expected_values.list_module_expected: assert o in loads(cli.stdout) -@mark.parametrize("command", ["discordai_modelizer"]) -def test_cli_training(script_runner, command, default_file_output): +def test_cli_training(script_runner, default_file_output): cli = script_runner.run( [ - command, + "discordai_modelizer", "model", "create", "-c", @@ -56,78 +54,71 @@ def test_cli_training(script_runner, command, default_file_output): assert "INFO: Starting OpenAI fine-tune job..." in cli.stdout -@mark.parametrize("command", ["discordai_modelizer"]) -def test_cli_model_list_full(script_runner, command): - cli = script_runner.run([command, "model", "list", "--full"]) +def test_cli_model_list_full(script_runner): + cli = script_runner.run(["discordai_modelizer", "model", "list", "--full"]) assert cli.success for o in expected_values.list_module_expected_full: assert o in loads(cli.stdout) -@mark.parametrize("command", ["discordai_modelizer"]) -def test_cli_delete_model(script_runner, command): - cli = script_runner.run([command, "model", "delete", "-m", "whisper-1"]) +def test_cli_delete_model(script_runner): + cli = script_runner.run( + ["discordai_modelizer", "model", "delete", "-m", "whisper-1"] + ) assert ( "Are you sure you want to delete this model? This action is not reversable. Y/N: " in cli.stdout ) -@mark.parametrize("command", ["discordai_modelizer"]) -def test_cli_job_list(script_runner, command): - cli = script_runner.run([command, "job", "list"]) +def test_cli_job_list(script_runner): + cli = script_runner.run(["discordai_modelizer", "job", "list"]) assert cli.success assert dumps(expected_values.list_job_expected, indent=4) in cli.stdout -@mark.parametrize("command", ["discordai_modelizer"]) -def test_job_list_full(script_runner, command): - cli = script_runner.run([command, "job", "list", "--full"]) +def test_job_list_full(script_runner): + cli = script_runner.run(["discordai_modelizer", "job", "list", "--full"]) assert cli.success assert dumps(expected_values.list_job_expected_full, indent=4) in cli.stdout -@mark.parametrize("command", ["discordai_modelizer"]) -def test_job_info(script_runner, command): +def test_job_info(script_runner): cli = script_runner.run( - [command, "job", "info", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"] + ["discordai_modelizer", "job", "info", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"] ) assert cli.success assert dumps(expected_values.job_info_expected, indent=4) in cli.stdout -@mark.parametrize("command", ["discordai_modelizer"]) -def test_job_events(script_runner, command): +def test_job_events(script_runner): cli = script_runner.run( - [command, "job", "events", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"] + ["discordai_modelizer", "job", "events", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"] ) assert cli.success assert dumps(expected_values.job_events_expected, indent=4) in cli.stdout -@mark.parametrize("command", ["discordai_modelizer"]) -def test_job_cancel(script_runner, command): +def test_job_cancel(script_runner): cli = script_runner.run( - [command, "job", "cancel", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"] + ["discordai_modelizer", "job", "cancel", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"] ) assert cli.success assert dumps(expected_values.job_cancel_expected, indent=4) in cli.stdout -@mark.parametrize("command", ["discordai_modelizer"]) -def test_job_cancel(script_runner, command): +def test_job_cancel(script_runner): cli = script_runner.run( - [command, "job", "cancel", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"] + ["discordai_modelizer", "job", "cancel", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"] ) assert cli.success assert dumps(expected_values.job_cancel_expected, indent=4) in cli.stdout -@mark.parametrize("command", ["discordai_modelizer"]) -def test_cli_model_bad_args(script_runner, command): +def test_cli_model_bad_args(script_runner): cli = script_runner.run( [ - command, + "discordai_modelizer", "model", ] ) @@ -135,11 +126,10 @@ def test_cli_model_bad_args(script_runner, command): assert "Must choose a command from `list`, `create`, or `delete`" in cli.stderr -@mark.parametrize("command", ["discordai_modelizer"]) -def test_cli_job_bad_args(script_runner, command): +def test_cli_job_bad_args(script_runner): cli = script_runner.run( [ - command, + "discordai_modelizer", "job", ] ) diff --git a/discordai_modelizer/tests/test_dataset.py b/tests/test_dataset.py similarity index 100% rename from discordai_modelizer/tests/test_dataset.py rename to tests/test_dataset.py diff --git a/discordai_modelizer/tests/test_modelization.py b/tests/test_modelization.py similarity index 100% rename from discordai_modelizer/tests/test_modelization.py rename to tests/test_modelization.py diff --git a/discordai_modelizer/tests/test_openai.py b/tests/test_openai.py similarity index 100% rename from discordai_modelizer/tests/test_openai.py rename to tests/test_openai.py