From 89ec3aff144b2659c0414d32fbd7d17fc5e49ede Mon Sep 17 00:00:00 2001 From: carlad Date: Mon, 17 Jan 2022 15:07:03 +0100 Subject: [PATCH] Update dependencies in 3.0 to align with rasa-sdk (#10667) * align dependencies * use black 21.7b0 * apply black and docstring reformatting * add changelog --- test_rasa_data.py | 7 +------ test_rasa_evaluate_markers.py | 2 +- test_rasa_init.py | 2 +- test_rasa_test.py | 6 ++---- test_rasa_train.py | 9 ++------- test_rasa_x.py | 2 +- 6 files changed, 8 insertions(+), 20 deletions(-) diff --git a/test_rasa_data.py b/test_rasa_data.py index fe1fd7a3ac2a..00041c82ad09 100644 --- a/test_rasa_data.py +++ b/test_rasa_data.py @@ -290,11 +290,6 @@ def test_validate_files_invalid_slot_mappings(tmp_path: Path): - location """ ) - args = { - "domain": str(domain), - "data": None, - "max_history": None, - "config": None, - } + args = {"domain": str(domain), "data": None, "max_history": None, "config": None} with pytest.raises(SystemExit): data.validate_files(namedtuple("Args", args.keys())(*args.values())) diff --git a/test_rasa_evaluate_markers.py b/test_rasa_evaluate_markers.py index 7abf506725d5..ce4762adf028 100644 --- a/test_rasa_evaluate_markers.py +++ b/test_rasa_evaluate_markers.py @@ -114,7 +114,7 @@ def test_markers_cli_results_save_correctly( endpoints_path = write_endpoint_config_to_yaml( tmp_path, - {"tracker_store": {"type": "sql", "db": db_path.replace("\\", "\\\\")},}, + {"tracker_store": {"type": "sql", "db": db_path.replace("\\", "\\\\")}}, ) markers_path = write_markers_config_to_yaml( diff --git a/test_rasa_init.py b/test_rasa_init.py index 9647937a6598..f442dc1885ee 100644 --- a/test_rasa_init.py +++ b/test_rasa_init.py @@ -77,7 +77,7 @@ def test_train_data_in_project_dir(monkeypatch: MonkeyPatch, tmp_path: Path): subparsers = parser.add_subparsers() scaffold.add_subparser(subparsers, parents=[]) - args = parser.parse_args(["init", "--no-prompt",]) + args = parser.parse_args(["init", "--no-prompt"]) # Simple config which should train fast. def mock_get_config(*args): diff --git a/test_rasa_test.py b/test_rasa_test.py index ddafedfa4728..582922fcfe9f 100644 --- a/test_rasa_test.py +++ b/test_rasa_test.py @@ -100,7 +100,7 @@ def test_test_with_no_user_utterance( run_in_simple_project_with_model: Callable[..., RunResult] ): write_yaml( - {"pipeline": "KeywordIntentClassifier", "policies": [{"name": "TEDPolicy"}],}, + {"pipeline": "KeywordIntentClassifier", "policies": [{"name": "TEDPolicy"}]}, "config.yml", ) @@ -160,9 +160,7 @@ def test_test_nlu_cross_validation_with_autoconfig( config_path = str(testdir.tmpdir / "config.yml") nlu_path = str(testdir.tmpdir / "nlu.yml") shutil.copy(str(moodbot_nlu_data_path), nlu_path) - write_yaml( - {"language": "en", "pipeline": None, "policies": None,}, config_path, - ) + write_yaml({"language": "en", "pipeline": None, "policies": None}, config_path) args = [ shutil.which("rasa"), "test", diff --git a/test_rasa_train.py b/test_rasa_train.py index e637f65ae4d9..64d0ebcb5bd6 100644 --- a/test_rasa_train.py +++ b/test_rasa_train.py @@ -14,10 +14,7 @@ from rasa.engine.storage.local_model_storage import LocalModelStorage from rasa.engine.storage.resource import Resource from rasa.shared.core.domain import Domain -from rasa.model_training import ( - CODE_NEEDS_TO_BE_RETRAINED, - CODE_FORCED_TRAINING, -) +from rasa.model_training import CODE_NEEDS_TO_BE_RETRAINED, CODE_FORCED_TRAINING # noinspection PyProtectedMember from rasa.cli.train import _get_valid_config @@ -69,9 +66,7 @@ def test_train(run_in_simple_project: Callable[..., RunResult], tmp_path: Path): def test_train_finetune( run_in_simple_project: Callable[..., RunResult], capsys: CaptureFixture ): - run_in_simple_project( - "train", "--finetune", - ) + run_in_simple_project("train", "--finetune") output = capsys.readouterr().out assert "No model for finetuning found" in output diff --git a/test_rasa_x.py b/test_rasa_x.py index f3694e62658b..07533baba7b0 100644 --- a/test_rasa_x.py +++ b/test_rasa_x.py @@ -161,7 +161,7 @@ async def test_pull_runtime_config_from_server(): def test_rasa_x_raises_warning_above_version_3( - monkeypatch: MonkeyPatch, run: Callable[..., RunResult], + monkeypatch: MonkeyPatch, run: Callable[..., RunResult] ): def mock_run_locally(args): return None