Skip to content

remove pause #1993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions arcade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def configure_logging(level: Optional[int] = None):
from .window_commands import finish_render
from .window_commands import get_display_size
from .window_commands import get_window
from .window_commands import pause
from .window_commands import schedule
from .window_commands import run
from .window_commands import set_background_color
Expand Down Expand Up @@ -352,7 +351,6 @@ def configure_logging(level: Optional[int] = None):
'make_soft_circle_texture',
'make_soft_square_texture',
'open_window',
'pause',
'print_timings',
'play_sound',
'read_tmx',
Expand Down
17 changes: 0 additions & 17 deletions arcade/window_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
from __future__ import annotations

import gc
import time
import os

import pyglet

from typing import (
Callable,
Optional,
cast,
Tuple,
TYPE_CHECKING
)
Expand All @@ -28,7 +26,6 @@

__all__ = [
"get_display_size",
"pause",
"get_window",
"set_window",
"set_viewport",
Expand Down Expand Up @@ -58,20 +55,6 @@ def get_display_size(screen_id: int = 0) -> Tuple[int, int]:
return screen.width, screen.height


def pause(seconds: float) -> None:
"""
Pause for the specified number of seconds. This is a convenience function that just calls time.sleep().

.. Warning::

This is mostly used for unit tests and is not likely to be
a good solution for pausing an application or game.

:param seconds: Time interval to pause in seconds.
"""
time.sleep(cast(float, seconds))


def get_window() -> "Window":
"""
Return a handle to the current window.
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/window/test_window.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import time

import arcade
import pyglet
Expand Down Expand Up @@ -53,6 +54,6 @@ def f():
pass

arcade.schedule(f, 1/60)
arcade.pause(0.01)
time.sleep(0.01)
arcade.unschedule(f)
window.test()