-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed coverage.py version 5.0+ issue with Cython plugin according to cython/cython#3515 Signed-off-by: Raragyay <let987let987@gmail.com>
- Loading branch information
Showing
10 changed files
with
68 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import time | ||
from timeit import default_timer | ||
|
||
import numpy as np | ||
|
||
from GRGym.agent import BaseAgent | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
import numpy as np | ||
import pytest | ||
|
||
from GRGym.agent import BaseAgent | ||
from GRGym.agent import BaseAgent, RandomAgent | ||
|
||
|
||
def test_act(): | ||
test_agent = BaseAgent() | ||
with pytest.raises(NotImplementedError): | ||
test_agent.act(np.zeros(57)) | ||
|
||
|
||
def test_reset(): | ||
test_agent = BaseAgent() | ||
with pytest.raises(NotImplementedError): | ||
test_agent.reset() | ||
|
||
|
||
def test_random(): | ||
test_agent = RandomAgent() | ||
np.random.seed(52) | ||
test_arr = np.random.rand(56) | ||
np.random.seed(52) | ||
given_arr = test_agent.act(np.zeros(57)) | ||
np.testing.assert_array_equal(test_arr, given_arr) | ||
assert test_agent.reset() is None # it shouldn't do anything |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pytest | ||
|
||
from GRGym.agent import RandomAgent | ||
from GRGym.simulation.match import Match | ||
from GRGym.agent import HandBuiltAgent | ||
|
||
|
||
def test_simulate(): | ||
agent_1 = HandBuiltAgent() | ||
agent_2 = HandBuiltAgent() | ||
m = Match(agent_1, agent_2) | ||
m.simulate_matches(1) |