Attempt to fix blackjack rendering tests (#2565)

* Consistently use os.path.join

* Update setup.py

Try to fix tests again
This commit is contained in:
Ariel Kwiatkowski
2022-01-19 23:28:43 +01:00
committed by GitHub
parent 95d649fdec
commit 186934562f
2 changed files with 4 additions and 2 deletions

View File

@@ -153,12 +153,12 @@ class BlackjackEnv(gym.Env):
def get_image(path): def get_image(path):
cwd = os.path.dirname(__file__) cwd = os.path.dirname(__file__)
image = pygame.image.load(cwd + "/" + path) image = pygame.image.load(os.path.join(cwd, path))
return image return image
def get_font(path, size): def get_font(path, size):
cwd = os.path.dirname(__file__) cwd = os.path.dirname(__file__)
font = pygame.font.Font((cwd + "/" + path), size) font = pygame.font.Font(os.path.join(cwd, path), size)
return font return font
small_font = get_font( small_font = get_font(

View File

@@ -55,6 +55,8 @@ setup(
"gym": [ "gym": [
"envs/mujoco/assets/*.xml", "envs/mujoco/assets/*.xml",
"envs/classic_control/assets/*.png", "envs/classic_control/assets/*.png",
"envs/toy_text/font/*.ttf",
"envs/toy_text/img/*.png",
] ]
}, },
tests_require=["pytest", "mock"], tests_require=["pytest", "mock"],