We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aabd606 commit 5d65e02Copy full SHA for 5d65e02
webdriver/tests/support/asserts.py
@@ -1,5 +1,3 @@
1
-import imghdr
2
-import json
3
from base64 import decodebytes
4
5
from webdriver import NoSuchAlertException, WebDriverException, WebElement
@@ -235,6 +233,5 @@ def assert_png(screenshot):
235
233
image = decodebytes(screenshot.encode())
236
234
else:
237
image = screenshot
238
- mime_type = imghdr.what("", image)
239
- assert mime_type == "png", "Expected image to be PNG, but it was {}".format(mime_type)
+ assert image.startswith(b'\211PNG\r\n\032\n'), "Expected image to be PNG"
240
return image
0 commit comments