Skip to content

Commit dea5119

Browse files
authored
Fix whels tests for torchaudio (#1162)
1 parent 3a1bfc9 commit dea5119

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

test/smoke_test/smoke_test.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@
2323
def get_anaconda_output_for_package(pkg_name_str):
2424
import subprocess as sp
2525

26-
cmd = "conda list --explicit"
27-
output = sp.getoutput(cmd)
28-
for item in output.split("\n"):
29-
if pkg_name_str in item:
30-
return item
31-
32-
# Get the last line only
33-
return f"{pkg_name_str} can't be found"
26+
# If we are installing using conda just list package name
27+
if installation_str.find("conda install") != -1:
28+
cmd = "conda list --explicit"
29+
output = sp.getoutput(cmd)
30+
for item in output.split("\n"):
31+
if pkg_name_str in item:
32+
return item
33+
return f"{pkg_name_str} can't be found"
34+
else:
35+
cmd = "conda list -f " + pkg_name_str
36+
output = sp.getoutput(cmd)
37+
# Get the last line only
38+
return output.strip().split('\n')[-1]
3439

3540

3641
def check_nightly_binaries_date() -> None:

0 commit comments

Comments
 (0)