From 792f7bfac5b49b9c36a77421f6b7541d314c3f79 Mon Sep 17 00:00:00 2001 From: Bouwe Andela Date: Fri, 29 Sep 2023 22:55:47 +0200 Subject: [PATCH] Fix tests --- tests/test_project.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/test_project.py b/tests/test_project.py index 694e43be..b48e7b9e 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -13,8 +13,8 @@ def test_project_folder(cookies): assert project.exit_code == 0 assert project.exception is None - assert project.project.basename == 'my-python-project' - assert project.project.isdir() + assert project.project_path.name == 'my-python-project' + assert project.project_path.is_dir() def run(args: Sequence[str], dirpath: os.PathLike) -> subprocess.CompletedProcess: @@ -46,9 +46,9 @@ def baked_with_development_dependencies(cookies_session, project_env_bin_dir): bin_dir = project_env_bin_dir latest_pip_output = run([f'{bin_dir}python', '-m', 'pip', 'install', '--upgrade', 'pip', 'setuptools'], result.project_path) assert latest_pip_output.returncode == 0 - pip_output = run([f'{bin_dir}python', '-m', 'pip', 'install', '--editable', '.[dev]'], result.project) + pip_output = run([f'{bin_dir}python', '-m', 'pip', 'install', '--editable', '.[dev]'], result.project_path) assert pip_output.returncode == 0 - return result.project + return result.project_path def test_pytest(baked_with_development_dependencies, project_env_bin_dir): @@ -116,10 +116,9 @@ def test_coverage_api_docs(baked_with_development_dependencies, project_env_bin_ assert result.returncode == 0 assert 'build succeeded' in result.stdout coverage_file = project_dir / 'docs' / '_build' / 'coverage' / 'python.txt' - coverage_file_lines = coverage_file.read_text('utf8').splitlines() - expected = ['Undocumented Python objects', - '==========================='] - assert coverage_file_lines == expected + coverage_file_lines = coverage_file.read_text('utf8') + expected = 'Undocumented Python objects' + assert coverage_file_lines.startswith(expected) def test_doctest_api_docs(baked_with_development_dependencies, project_env_bin_dir): @@ -136,7 +135,7 @@ def test_prospector(baked_with_development_dependencies, project_env_bin_dir): project_dir = baked_with_development_dependencies bin_dir = project_env_bin_dir - result = run([f'{bin_dir}prospector'], project_dir) + result = run([f'{bin_dir}prospector', '--no-autodetect'], project_dir) assert result.returncode == 0 assert 'Messages Found: 0' in result.stdout