Skip to content

Commit

Permalink
tests: fix site path usage
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Apr 7, 2021
1 parent c98ec5d commit bd267c8
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tests/installation/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,10 @@ def test_executor_should_write_pep610_url_references_for_files(
executor = Executor(tmp_venv, pool, config, io)
executor.execute([Install(package)])

dist_info = tmp_venv.site_packages.path.joinpath("demo-0.1.0.dist-info")
assert dist_info.exists()
dist_info = "demo-0.1.0.dist-info"
assert tmp_venv.site_packages.exists(dist_info)

dist_info = tmp_venv.site_packages.find(dist_info)[0]
direct_url_file = dist_info.joinpath("direct_url.json")

assert direct_url_file.exists()
Expand All @@ -303,9 +304,10 @@ def test_executor_should_write_pep610_url_references_for_directories(
executor = Executor(tmp_venv, pool, config, io)
executor.execute([Install(package)])

dist_info = tmp_venv.site_packages.path.joinpath("simple_project-1.2.3.dist-info")
assert dist_info.exists()
dist_info = "simple_project-1.2.3.dist-info"
assert tmp_venv.site_packages.exists(dist_info)

dist_info = tmp_venv.site_packages.find(dist_info)[0]
direct_url_file = dist_info.joinpath("direct_url.json")

assert direct_url_file.exists()
Expand Down Expand Up @@ -356,9 +358,10 @@ def test_executor_should_write_pep610_url_references_for_urls(
executor = Executor(tmp_venv, pool, config, io)
executor.execute([Install(package)])

dist_info = tmp_venv.site_packages.path.joinpath("demo-0.1.0.dist-info")
assert dist_info.exists()
dist_info = "demo-0.1.0.dist-info"
assert tmp_venv.site_packages.exists(dist_info)

dist_info = tmp_venv.site_packages.find(dist_info)[0]
direct_url_file = dist_info.joinpath("direct_url.json")

assert direct_url_file.exists()
Expand Down Expand Up @@ -386,9 +389,10 @@ def test_executor_should_write_pep610_url_references_for_git(
executor = Executor(tmp_venv, pool, config, io)
executor.execute([Install(package)])

dist_info = tmp_venv.site_packages.path.joinpath("demo-0.1.2.dist-info")
assert dist_info.exists()
dist_info = "demo-0.1.2.dist-info"
assert tmp_venv.site_packages.exists(dist_info)

dist_info = tmp_venv.site_packages.find(dist_info)[0]
direct_url_file = dist_info.joinpath("direct_url.json")

assert direct_url_file.exists()
Expand Down

0 comments on commit bd267c8

Please sign in to comment.