aboutsummaryrefslogtreecommitdiffstats
path: root/solo_tool_integrationtest.py
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2022-01-01 17:00:15 +0100
committerEddy Pedroni <eddy@0xf7.com>2022-01-01 17:00:15 +0100
commitd28a1b91afa86b6e39ac4df24d8bada7e795b20b (patch)
treef4172a6ab6cfc5c8314bce45b444494c0ea838cf /solo_tool_integrationtest.py
parentd3be030dd3bc1e737870c676f9179e6fdd106a5d (diff)
Improved tmp_path usage in solo tool tests
Diffstat (limited to 'solo_tool_integrationtest.py')
-rw-r--r--solo_tool_integrationtest.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/solo_tool_integrationtest.py b/solo_tool_integrationtest.py
index b9ce62e..d0123d5 100644
--- a/solo_tool_integrationtest.py
+++ b/solo_tool_integrationtest.py
@@ -13,8 +13,8 @@ def mockPlayer():
def uut(mockPlayer):
return SoloTool(mockPlayer)
-@pytest.fixture(autouse=True)
-def copyTestFiles(tmp_path):
+@pytest.fixture
+def prepared_tmp_path(tmp_path):
testFiles = [
"test.flac",
"test.mp3",
@@ -23,6 +23,8 @@ def copyTestFiles(tmp_path):
for f in testFiles:
shutil.copy(pathlib.Path(f), tmp_path)
+ return tmp_path
+
def test_playerControls(uut, mockPlayer):
assert mockPlayer.state == MockPlayer.STOPPED
assert uut.isPlaying() == False
@@ -204,12 +206,12 @@ def test_storeAbLimitsWithoutSong(uut, mockPlayer):
uut.tick()
assert mockPlayer.position == abLimit[0]
-def test_loadAndSaveSession(tmp_path):
+def test_loadAndSaveSession(prepared_tmp_path):
mockPlayer = MockPlayer()
uut = SoloTool(mockPlayer)
- loadedSessionFile = tmp_path / "test_session.json"
- savedSessionFile = tmp_path / "test_session_save.json"
+ loadedSessionFile = prepared_tmp_path / "test_session.json"
+ savedSessionFile = prepared_tmp_path / "test_session_save.json"
uut.loadSession(loadedSessionFile)
uut.saveSession(savedSessionFile)