MCPcopy
hub / github.com/mosaicml/composer / test_invalid_math

Function test_invalid_math

tests/test_time.py:71–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69
70
71def test_invalid_math():
72 t1 = Time.from_timestring('1ep')
73 t2 = Time.from_timestring('1ba')
74
75 with pytest.raises(RuntimeError):
76 _ = t1 > t2
77
78 with pytest.raises(RuntimeError):
79 _ = t1 < t2
80
81 with pytest.raises(RuntimeError):
82 _ = t1 >= t2
83
84 with pytest.raises(RuntimeError):
85 _ = t1 <= t2
86
87 with pytest.raises(RuntimeError):
88 _ = t1 == t2
89
90 with pytest.raises(RuntimeError):
91 _ = t1 != t2
92
93 with pytest.raises(RuntimeError):
94 _ = t1 + t2
95
96 with pytest.raises(RuntimeError):
97 _ = t1 - t2
98
99 with pytest.raises(RuntimeError):
100 _ = t1 / t2
101
102 with pytest.raises(RuntimeError):
103 _ = t1 % t2
104
105 with pytest.raises(RuntimeError):
106 _ = t1 * t2
107
108
109def test_time_from_input():

Callers

nothing calls this directly

Calls 1

from_timestringMethod · 0.80

Tested by

no test coverage detected