Skip to content

Commit 43e9a2e

Browse files
authored
fix: Set torch to None when import fails in conftest (#21357)
1 parent 78c729e commit 43e9a2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# import to happen first for all tests.
1111
import torch # noqa: F401
1212
except ImportError:
13-
pass
13+
torch = None
1414

1515
import pytest # noqa: E402
1616

0 commit comments

Comments
 (0)