From 3e98fd8f7c46ccf5d549c3c87cb331ba8a164101 Mon Sep 17 00:00:00 2001 From: Jay Pratt Date: Thu, 8 Feb 2024 02:43:44 +1100 Subject: [PATCH] Correct tests handling paths to files where paths to directories are expected (#8947) ... and use existing in place of missing fixture in empty repositories key test --- tests/console/commands/test_config.py | 2 +- tests/test_factory.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/console/commands/test_config.py b/tests/console/commands/test_config.py index d96077cc307..7c5a370132e 100644 --- a/tests/console/commands/test_config.py +++ b/tests/console/commands/test_config.py @@ -234,7 +234,7 @@ def test_display_empty_repositories_setting( ) -> None: tester = command_tester_factory( "config", - poetry=Factory().create_poetry(fixture_dir("with_empty_repositories_key")), + poetry=Factory().create_poetry(fixture_dir("with_local_config")), ) tester.execute("repositories") diff --git a/tests/test_factory.py b/tests/test_factory.py index 075d2dfb869..d9e49ce8a68 100644 --- a/tests/test_factory.py +++ b/tests/test_factory.py @@ -519,7 +519,7 @@ def test_create_poetry_fails_on_invalid_configuration( fixture_dir: FixtureDirGetter, ) -> None: with pytest.raises(RuntimeError) as e: - Factory().create_poetry(fixture_dir("invalid_pyproject") / "pyproject.toml") + Factory().create_poetry(fixture_dir("invalid_pyproject")) fastjsonschema_error = "data must contain ['description'] properties" custom_error = "The fields ['description'] are required in package mode." @@ -541,7 +541,7 @@ def test_create_poetry_fails_on_nameless_project( fixture_dir: FixtureDirGetter, ) -> None: with pytest.raises(RuntimeError) as e: - Factory().create_poetry(fixture_dir("nameless_pyproject") / "pyproject.toml") + Factory().create_poetry(fixture_dir("nameless_pyproject")) fastjsonschema_error = "data must contain ['name'] properties" custom_error = "The fields ['name'] are required in package mode."