Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
95e95b6d
Unverified
Commit
95e95b6d
authored
Jun 27, 2023
by
Frank Lee
Committed by
GitHub
Jun 27, 2023
Browse files
[testing] move pytest to be inside the function (#4087)
parent
4da324cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
colossalai/testing/pytest_wrapper.py
colossalai/testing/pytest_wrapper.py
+7
-2
No files found.
colossalai/testing/pytest_wrapper.py
View file @
95e95b6d
...
...
@@ -4,7 +4,6 @@ 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
...
...
@@ -30,6 +29,12 @@ def run_on_environment_flag(name: str):
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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment