Skip to content

Commit d47f95f

Browse files
author
Ryan Walker
committed
Add requirements to virtualenv tests
The tests for virtualenvs were previously finding the 'requirements.txt' file at the root of this repo instead of function_dir. If we change to looking for 'requirements.txt' in function_dir instead, these tests fail because no requirements are found and thus, no virtualenv is created.
1 parent d58fe97 commit d47f95f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/test_package.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def test_prepare_workspace():
3838
temp_workspace = path.join(TESTING_TEMP_DIR,
3939
package.TEMP_WORKSPACE_NAME)
4040

41-
pkg = package.Package(TESTING_TEMP_DIR)
41+
reqs = ['pytest']
42+
pkg = package.Package(TESTING_TEMP_DIR, requirements=reqs)
4243
pkg.prepare_workspace()
4344
pkg.prepare_virtualenv()
4445
assert path.isdir(temp_workspace)
@@ -68,7 +69,8 @@ def test_install_requirements():
6869
def test_default_virtualenv():
6970
temp_workspace = path.join(TESTING_TEMP_DIR,
7071
package.TEMP_WORKSPACE_NAME)
71-
pkg = package.Package(TESTING_TEMP_DIR)
72+
reqs = ['pytest']
73+
pkg = package.Package(TESTING_TEMP_DIR, requirements=reqs)
7274
pkg.prepare_virtualenv()
7375
# ensure we picked a real venv path if using default behavior
7476
assert pkg._pkg_venv == ("%s/venv" % temp_workspace)

0 commit comments

Comments
 (0)