Skip to content

Commit

Permalink
Try not using temporary file from os
Browse files Browse the repository at this point in the history
  • Loading branch information
Conengmo committed Jun 13, 2020
1 parent 86ad08b commit d8aa4e9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/selenium/test_heat_map_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ def test_heat_map_with_weights(driver):
blur=50,
).add_to(m)
html = m.get_root().render()
with temp_html_filepath(html) as filepath:
driver.get('file://' + filepath)
assert driver.wait_until('.folium-map')
driver.verify_js_logs()
filepath = os.path.abspath('temp.html')
with open(filepath, 'w') as f:
f.write(html)
# with temp_html_filepath(html) as filepath:
driver.get('file://' + filepath)
assert driver.wait_until('.folium-map')
driver.verify_js_logs()
os.remove('temp.html')
assert driver.wait_until('canvas.leaflet-heatmap-layer')
screenshot = driver.get_screenshot_as_png()
path = os.path.dirname(__file__)
Expand Down

0 comments on commit d8aa4e9

Please sign in to comment.