mirror of
https://github.com/wassname/ray.git
synced 2026-07-04 16:48:40 +08:00
[Core] Type check ObjectRef (#9856)
* Type check ObjectRef * Bug fix * Port typing tests to bazel test
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
import mypy.api as mypy_api
|
||||
import pytest
|
||||
|
||||
TYPING_TEST_DIRS = os.path.join(os.path.dirname(__file__), "typing_files")
|
||||
|
||||
|
||||
def test_typing_good():
|
||||
script = os.path.join(TYPING_TEST_DIRS, "check_typing_good.py")
|
||||
msg, _, status_code = mypy_api.run([script])
|
||||
assert status_code == 0, msg
|
||||
|
||||
|
||||
def test_typing_bad():
|
||||
script = os.path.join(TYPING_TEST_DIRS, "check_typing_bad.py")
|
||||
msg, _, status_code = mypy_api.run([script])
|
||||
assert status_code == 1, msg
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Make subprocess happy in bazel.
|
||||
os.environ["LC_ALL"] = "en_US.UTF-8"
|
||||
os.environ["LANG"] = "en_US.UTF-8"
|
||||
sys.exit(pytest.main(["-v", __file__]))
|
||||
Reference in New Issue
Block a user