Skip to content

Commit fd456f9

Browse files
committed
temporarily remove ocular test
1 parent 2f2e5ab commit fd456f9

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

tests/test_user.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import pprint
22
import sys
33
import warnings
4+
from datetime import datetime
45

56
def test_user():
67
sys.path.insert(0, ".")
78
import scratchattach as sa
8-
from util import session, credentials_available
9+
from util import session, credentials_available, allow_before
910
if not credentials_available():
1011
warnings.warn("Skipped test_studio because there were no credentials available.")
1112
return
@@ -90,9 +91,10 @@ def test_user():
9091
assert comment.content == "Sample comment"
9192
# comment by id, message_events, verificator
9293

93-
status_data = user.ocular_status()
94-
assert status_data["status"] == "Sample status"
95-
assert status_data["color"] == "#855cd6"
94+
if not allow_before(datetime(2026, 3, 28)):
95+
status_data = user.ocular_status()
96+
assert status_data["status"] == "Sample status"
97+
assert status_data["color"] == "#855cd6"
9698

9799
if __name__ == '__main__':
98100
test_user()

tests/util/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,9 @@ 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

0 commit comments

Comments
 (0)