Add fixed clock deltatime so we can close #1543 by DragonMoffon · Pull Request #2421 · pythonarcade/arcade · GitHub
Skip to content
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
25 changes: 25 additions & 0 deletions arcade/clock.py
8 changes: 8 additions & 0 deletions tests/integration/examples/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import arcade
import pytest

import arcade.clock

# File path, module path
EXAMPLE_LOCATIONS = [
(
Expand Down Expand Up @@ -83,6 +85,12 @@ def test_examples(window_proxy, module_path, file_path, allow_stdout):
# Manually load the module as __main__ so it runs on import
loader = SourceFileLoader("__main__", str(file_path))
loader.exec_module(loader.load_module())

# Reset the global clock's tick speed
# is this a good argument against a global scope clock?
# yes.
arcade.clock.GLOBAL_CLOCK.set_tick_speed(1.0)


if not allow_stdout:
output = stdout.getvalue()
Expand Down
23 changes: 23 additions & 0 deletions tests/unit/test_clock.py