@@ -96,8 +96,8 @@ def test_locator_debugging(page: Page, local_app: ShinyAppProc) -> None:
96
96
with pytest .raises (AssertionError ) as e :
97
97
not_exist .expect_choices (["a" , "b" , "c" ], timeout = timeout )
98
98
99
- assert "expected to have count '1'" in str (e )
100
- assert "Actual value: 0" in str (e )
99
+ assert "expected to have count '1'" in str (e . value )
100
+ assert "Actual value: 0" in str (e . value )
101
101
102
102
check1 = InputCheckboxGroup (page , "check1" )
103
103
@@ -106,18 +106,18 @@ def test_locator_debugging(page: Page, local_app: ShinyAppProc) -> None:
106
106
# Too many
107
107
with pytest .raises (AssertionError ) as e :
108
108
check1 .expect_choices (["red" , "green" , "blue" , "test_value" ], timeout = timeout )
109
- assert "expected to have count '4'" in str (e )
110
- assert "Actual value: 3" in str (e )
109
+ assert "expected to have count '4'" in str (e . value )
110
+ assert "Actual value: 3" in str (e . value )
111
111
# Not enough
112
112
with pytest .raises (AssertionError ) as e :
113
113
check1 .expect_choices (["red" , "green" ], timeout = timeout )
114
- assert "expected to have count '2'" in str (e )
115
- assert "Actual value: 3" in str (e )
114
+ assert "expected to have count '2'" in str (e . value )
115
+ assert "Actual value: 3" in str (e . value )
116
116
# Wrong value
117
117
with pytest .raises (AssertionError ) as e :
118
118
check1 .expect_choices (["red" , "green" , "test_value" ], timeout = timeout )
119
- assert "attribute 'test_value'" in str (e )
120
- assert "Actual value: blue" in str (e )
119
+ assert "attribute 'test_value'" in str (e . value )
120
+ assert "Actual value: blue" in str (e . value )
121
121
122
122
123
123
def test_locator_existance (page : Page , local_app : ShinyAppProc ) -> None :
@@ -129,8 +129,10 @@ def test_locator_existance(page: Page, local_app: ShinyAppProc) -> None:
129
129
not_exist = InputCheckboxGroup (page , "does-not-exist" )
130
130
with pytest .raises (AssertionError ) as e :
131
131
not_exist .set (["green" ], timeout = timeout )
132
- assert "expected to have count '1'" in str (e )
133
- assert "Actual value: 0" in str (e )
132
+
133
+ print (str (e .value ))
134
+ assert "expected to have count '1'" in str (e .value )
135
+ assert "Actual value: 0" in str (e .value )
134
136
135
137
check1 = InputCheckboxGroup (page , "check1" )
136
138
@@ -143,14 +145,14 @@ def test_locator_existance(page: Page, local_app: ShinyAppProc) -> None:
143
145
# Different value
144
146
with pytest .raises (AssertionError ) as e :
145
147
check1 .set (["test_value" ], timeout = timeout )
146
- assert "expected to have count '1'" in str (e )
147
- assert "Actual value: 0" in str (e )
148
+ assert "expected to have count '1'" in str (e . value )
149
+ assert "Actual value: 0" in str (e . value )
148
150
149
151
# Extra value
150
152
with pytest .raises (AssertionError ) as e :
151
153
check1 .set (["blue" , "test_value" ], timeout = timeout )
152
154
153
- assert "expected to have count '1'" in str (e )
154
- assert "Actual value: 0" in str (e )
155
+ assert "expected to have count '1'" in str (e . value )
156
+ assert "Actual value: 0" in str (e . value )
155
157
156
158
check1 .expect_selected (["green" ])
0 commit comments