Skip to content

Commit 02fc0e0

Browse files
committed
temporarily remove ocular test
1 parent 62414e6 commit 02fc0e0

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

tests/test_user.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import warnings
2+
from datetime import datetime
23
import scratchattach as sa
3-
from util import session, credentials_available
4-
4+
from util import session, credentials_available, allow_before
55

66
def test_user():
77
if not credentials_available():
@@ -102,9 +102,10 @@ def test_user():
102102
assert comment.content == "Sample comment"
103103
# comment by id, message_events, verificator
104104

105-
status_data = user.ocular_status()
106-
assert status_data["status"] == "Sample status"
107-
assert status_data["color"] == "#855cd6"
105+
if not allow_before(datetime(2026, 3, 28)):
106+
status_data = user.ocular_status()
107+
assert status_data["status"] == "Sample status"
108+
assert status_data["color"] == "#855cd6"
108109

109110
uukelele = sess.connect_user("uukelele") # could use anyone ScratchAttachV2 is following right now but i think its cool that its following my account - uukelele, 2026
110111
assert uukelele.is_followed_by_me()

tests/util/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,10 @@ def teacher_session() -> Optional[_Session]:
4545
return _teacher_session
4646

4747
def allow_before(d: datetime) -> bool:
48+
"""
49+
Used with the `or` operator.
50+
If an assertion would be false, put the `allow_before` after the condition.
51+
If a test incorrectly errors, put the `allow_before` before the condition.
52+
"""
4853
return datetime.now() < d
4954

0 commit comments

Comments
 (0)