-
-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathconftest.py
More file actions
33 lines (26 loc) · 760 Bytes
/
Copy pathconftest.py
File metadata and controls
33 lines (26 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import pytest
import pygame
from game import Game
from grid import Grid
from blocks import TBlock
import pygame
@pytest.fixture(scope="function")
def game_instance(monkeypatch):
monkeypatch.setattr(pygame.mixer, "Sound", lambda x: DummySound())
monkeypatch.setattr(pygame.mixer.music, "load", lambda x: None)
monkeypatch.setattr(pygame.mixer.music, "play", lambda x: None)
return Game()
class DummySound:
def play(self): pass
@pytest.fixture
def empty_grid():
return Grid()
@pytest.fixture
def full_row_grid():
grid = Grid()
for col in range(grid.num_cols):
grid.grid[19][col] = 1 # שורה מלאה בתחתית
return grid
@pytest.fixture
def t_block():
return TBlock()