@@ -18,7 +18,29 @@ def test_basic_category_install(pipenv_instance_private_pypi):
18
18
19
19
@pytest .mark .categories
20
20
@pytest .mark .install
21
- @pytest .mark .parametrize ('categories' , ["prereq other" , "prereq, other" ])
21
+ @pytest .mark .requirements
22
+ def test_basic_category_install_from_requirements (pipenv_instance_private_pypi ):
23
+ with pipenv_instance_private_pypi (pipfile = False ) as p :
24
+ # Write a requirements file
25
+ with open ("requirements.txt" , "w" ) as f :
26
+ f .write (f"six==1.16.0" )
27
+
28
+ c = p .pipenv ("install --categories prereq" )
29
+ assert c .returncode == 0
30
+ os .unlink ("requirements.txt" )
31
+ print (c .stdout )
32
+ print (c .stderr )
33
+ # assert stuff in pipfile
34
+ assert c .returncode == 0
35
+ assert "six" not in p .pipfile ["packages" ]
36
+ assert "six" not in p .lockfile ["default" ]
37
+ assert "six" in p .pipfile ["prereq" ]
38
+ assert "six" in p .lockfile ["prereq" ]
39
+
40
+
41
+ @pytest .mark .categories
42
+ @pytest .mark .install
43
+ @pytest .mark .parametrize ("categories" , ["prereq other" , "prereq, other" ])
22
44
def test_multiple_category_install (pipenv_instance_private_pypi , categories ):
23
45
with pipenv_instance_private_pypi () as p :
24
46
c = p .pipenv ('install six --categories="prereq other"' )
@@ -31,6 +53,30 @@ def test_multiple_category_install(pipenv_instance_private_pypi, categories):
31
53
assert "six" in p .lockfile ["other" ]
32
54
33
55
56
+ @pytest .mark .categories
57
+ @pytest .mark .install
58
+ @pytest .mark .requirements
59
+ def test_multiple_category_install_from_requirements (pipenv_instance_private_pypi ):
60
+ with pipenv_instance_private_pypi (pipfile = False ) as p :
61
+ # Write a requirements file
62
+ with open ("requirements.txt" , "w" ) as f :
63
+ f .write ("six==1.16.0" )
64
+
65
+ c = p .pipenv ('install --categories="prereq other"' )
66
+ assert c .returncode == 0
67
+ os .unlink ("requirements.txt" )
68
+ print (c .stdout )
69
+ print (c .stderr )
70
+ # assert stuff in pipfile
71
+ assert c .returncode == 0
72
+ assert "six" not in p .pipfile ["packages" ]
73
+ assert "six" not in p .lockfile ["default" ]
74
+ assert "six" in p .pipfile ["prereq" ]
75
+ assert "six" in p .lockfile ["prereq" ]
76
+ assert "six" in p .pipfile ["other" ]
77
+ assert "six" in p .lockfile ["other" ]
78
+
79
+
34
80
@pytest .mark .extras
35
81
@pytest .mark .install
36
82
@pytest .mark .local
0 commit comments