Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Commit

Permalink
Add a bit of a test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhdu committed Jul 6, 2018
1 parent 84b230f commit b38cc2b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/fail/random.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import numpy as np

np.random.RandomState(b"hello") # E: incompatible type
np.random.RandomState("") # E: incompatible type

np.random.beta(3) # E: No overload variant
np.random.beta(3, "hello") # E: incompatible type
np.random.beta(3, 4, "hello") # E: incompatible type
5 changes: 5 additions & 0 deletions tests/pass/random.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import numpy as np

state = np.random.RandomState()
state = np.random.RandomState(3)
state = np.random.RandomState([3])
4 changes: 4 additions & 0 deletions tests/reveal/random.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import numpy as np

np.random.beta(3, 4.0) # E: float
np.random.beta(3.0, 4.0, size=[3, 4]) # E: ndarray

0 comments on commit b38cc2b

Please sign in to comment.