Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions test/integration/plugin/test_projectpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def test_project_path_from_toml_config(pytester):
def test_arch(arch_project_paths, pytestconfig):
assert len(arch_project_paths) == 2
assert arch_project_paths[0] == pytestconfig.rootpath / 'foobar'
assert arch_project_paths[1] == Path('/foo/bar')
drive = ''
if arch_project_paths[1].drive:
drive = arch_project_paths[1].drive
Comment on lines +22 to +24
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can replace this with just drive = arch_project_paths[1].drive?
On non-Windows systems drive should be an empty string.

assert arch_project_paths[1] == Path(f'{drive}/foo/bar')
"""
)
result = pytester.runpytest()
Expand All @@ -43,7 +46,10 @@ def test_project_path_from_ini_config(pytester):
def test_arch(arch_project_paths, pytestconfig):
assert len(arch_project_paths) == 2
assert arch_project_paths[0] == pytestconfig.rootpath / 'foobar'
assert arch_project_paths[1] == Path('/foo/bar')
drive = ''
if arch_project_paths[1].drive:
drive = arch_project_paths[1].drive
Comment on lines +49 to +51
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

assert arch_project_paths[1] == Path(f'{drive}/foo/bar')

"""
)
Expand All @@ -62,7 +68,7 @@ def test_project_path_from_heuristic_with_src_dir(pytester):
def test_path(arch_project_paths):
assert len(arch_project_paths) == 1
assert (str(arch_project_paths[0]) ==
'{pytester.path / 'root' / 'src'}')
r'{pytester.path / 'root' / 'src'}')
"""
)
)
Expand All @@ -80,7 +86,9 @@ def test_project_path_from_heuristic_with_nested_dirs(pytester):
f"""
def test_path(arch_project_paths):
assert len(arch_project_paths) == 1
assert str(arch_project_paths[0]) == '{pytester.path / 'root'}'
assert (
str(arch_project_paths[0]) == r'{pytester.path / 'root'}'
)
"""
)
)
Expand All @@ -100,7 +108,9 @@ def test_project_path_from_heuristic_with_setup_py(pytester):
f"""
def test_path(arch_project_paths):
assert len(arch_project_paths) == 1
assert str(arch_project_paths[0]) == '{pytester.path / 'root'}'
assert (
str(arch_project_paths[0]) == r'{pytester.path / 'root'}'
)
"""
)
)
Expand Down