Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions colossalai/testing/pytest_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""
This file will not be automatically imported by `colossalai.testing`
as this file has a dependency on `pytest`. Therefore, you need to
as this file has a dependency on `pytest`. Therefore, you need to
explicitly import this file `from colossalai.testing.pytest_wrapper import <func>`.from
"""

import pytest
import os


Expand All @@ -30,6 +29,12 @@ def test_for_something():
pytest test_for_something.py

"""
try:
import pytest
except ImportError:
raise ImportError(
'This function requires `pytest` to be installed, please do `pip install pytest` and try again.')

assert isinstance(name, str)
flag = os.environ.get(name.upper(), '0')

Expand Down