Skip to content

Commit 8a52fc4

Browse files
committed
Refactor skip tests
1 parent e7367d1 commit 8a52fc4

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

tests/test_jericho.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import sys
3-
import unittest
3+
import pytest
44
from os.path import join as pjoin
55

66
import jericho
@@ -96,10 +96,11 @@ def test_copy():
9696
assert (obs, rew, done, info) == expected[j]
9797

9898

99+
@pytest.mark.skipif(not os.path.exists(pjoin(DATA_PATH, "roms", "yomomma.z8")), reason="Missing data: roms/yomomma.z8")
99100
def test_saving_opcode_in_state():
100101
# At some point in yomomma.z8, the player is asked to hit [enter] to continue.
101102
# Restoring to that particular state without setting the opcode appropriately
102-
# would result in the emulated halting.
103+
# would result in the emulator halting.
103104
COMMANDS = [
104105
'south', 'southeast', 'sit', 'wait', 'yes', 'west', 'north', # Actions needed to reach the corner case.
105106
'get in stage', # -> opcode == 246 (z_read_char)
@@ -112,9 +113,6 @@ def test_saving_opcode_in_state():
112113
]
113114

114115
rom = pjoin(DATA_PATH, "roms", "yomomma.z8")
115-
if not os.path.exists(rom):
116-
raise unittest.SkipTest("Missing data: {}".format(rom))
117-
118116
env = jericho.FrotzEnv(rom)
119117
env.reset()
120118

0 commit comments

Comments
 (0)