29
29
from tests .repositories .test_pypi_repository import MockRepository
30
30
31
31
32
- fixtures_dir = Path ("tests/fixtures" )
33
-
34
-
35
32
class Installer (BaseInstaller ):
36
33
def _get_installer (self ):
37
34
return NoopInstaller ()
@@ -779,8 +776,8 @@ def test_installer_with_pypi_repository(package, locker, installed, config):
779
776
assert locker .written_data == expected
780
777
781
778
782
- def test_run_installs_with_local_file (installer , locker , repo , package ):
783
- file_path = fixtures_dir / "distributions/demo-0.1.0-py2.py3-none-any.whl"
779
+ def test_run_installs_with_local_file (installer , locker , repo , package , fixture_dir ):
780
+ file_path = fixture_dir ( "distributions/demo-0.1.0-py2.py3-none-any.whl" )
784
781
package .add_dependency (Factory .create_dependency ("demo" , {"file" : str (file_path )}))
785
782
786
783
repo .add_package (get_package ("pendulum" , "1.4.4" ))
@@ -793,9 +790,11 @@ def test_run_installs_with_local_file(installer, locker, repo, package):
793
790
assert 2 == installer .executor .installations_count
794
791
795
792
796
- def test_run_installs_wheel_with_no_requires_dist (installer , locker , repo , package ):
797
- file_path = (
798
- fixtures_dir / "wheel_with_no_requires_dist/demo-0.1.0-py2.py3-none-any.whl"
793
+ def test_run_installs_wheel_with_no_requires_dist (
794
+ installer , locker , repo , package , fixture_dir
795
+ ):
796
+ file_path = fixture_dir (
797
+ "wheel_with_no_requires_dist/demo-0.1.0-py2.py3-none-any.whl"
799
798
)
800
799
package .add_dependency (Factory .create_dependency ("demo" , {"file" : str (file_path )}))
801
800
@@ -809,31 +808,29 @@ def test_run_installs_wheel_with_no_requires_dist(installer, locker, repo, packa
809
808
810
809
811
810
def test_run_installs_with_local_poetry_directory_and_extras (
812
- installer , locker , repo , package , tmpdir
811
+ installer , locker , repo , package , tmpdir , fixture_dir
813
812
):
814
- file_path = fixtures_dir / "project_with_extras"
813
+ file_path = fixture_dir ( "project_with_extras" )
815
814
package .add_dependency (
816
815
Factory .create_dependency (
817
816
"project-with-extras" , {"path" : str (file_path ), "extras" : ["extras_a" ]}
818
817
)
819
818
)
820
- print (package .requires [0 ].develop )
821
819
822
820
repo .add_package (get_package ("pendulum" , "1.4.4" ))
823
821
824
822
installer .run ()
825
823
826
824
expected = fixture ("with-directory-dependency-poetry" )
827
-
828
825
assert locker .written_data == expected
829
826
830
827
assert 2 == installer .executor .installations_count
831
828
832
829
833
830
def test_run_installs_with_local_poetry_directory_transitive (
834
- installer , locker , repo , package , tmpdir
831
+ installer , locker , repo , package , tmpdir , fixture_dir
835
832
):
836
- root_dir = fixtures_dir . joinpath ("directory" )
833
+ root_dir = fixture_dir ("directory" )
837
834
package .root_dir = root_dir
838
835
locker .set_lock_path (root_dir )
839
836
directory = root_dir .joinpath ("project_with_transitive_directory_dependencies" )
@@ -858,12 +855,12 @@ def test_run_installs_with_local_poetry_directory_transitive(
858
855
859
856
860
857
def test_run_installs_with_local_poetry_file_transitive (
861
- installer , locker , repo , package , tmpdir
858
+ installer , locker , repo , package , tmpdir , fixture_dir
862
859
):
863
- root_dir = fixtures_dir . joinpath ("directory" )
860
+ root_dir = fixture_dir ("directory" )
864
861
package .root_dir = root_dir
865
862
locker .set_lock_path (root_dir )
866
- directory = fixtures_dir . joinpath ("directory" ).joinpath (
863
+ directory = fixture_dir ("directory" ).joinpath (
867
864
"project_with_transitive_file_dependencies"
868
865
)
869
866
package .add_dependency (
@@ -887,9 +884,9 @@ def test_run_installs_with_local_poetry_file_transitive(
887
884
888
885
889
886
def test_run_installs_with_local_setuptools_directory (
890
- installer , locker , repo , package , tmpdir
887
+ installer , locker , repo , package , tmpdir , fixture_dir
891
888
):
892
- file_path = fixtures_dir / "project_with_setup/"
889
+ file_path = fixture_dir ( "project_with_setup/" )
893
890
package .add_dependency (
894
891
Factory .create_dependency ("project-with-setup" , {"path" : str (file_path )})
895
892
)
0 commit comments