This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1485944341219 geckodriver INFO Listening on 127.0.0.1:41675 | |
1485944341325 mozprofile::profile INFO Using profile path /tmp/rust_mozprofile.t3ZWzjAMYYxm | |
1485944341326 geckodriver::marionette INFO Starting browser /usr/bin/firefox | |
1485944341329 geckodriver::marionette INFO Connecting to Marionette on localhost:37053 | |
1485944342011 Marionette INFO Listening on port 37053 | |
JavaScript error: chrome://marionette/content/listener.js, line 1028: NS_ERROR_UNKNOWN_PROTOCOL: | |
[Child 14847] ###!!! ABORT: Aborting on channel error.: file /build/firefox-K2Dm8Y/firefox-51.0.1+build2/ipc/glue/MessageChannel.cpp, line 2056 | |
[Child 14847] ###!!! ABORT: Aborting on channel error.: file /build/firefox-K2Dm8Y/firefox-51.0.1+build2/ipc/glue/MessageChannel.cpp, line 2056 | |
1485944344034 geckodriver INFO Listening on 127.0.0.1:34003 | |
1485944345118 mozprofile::profile INFO Using profile path /tmp/rust_mozprofile.O1yJi6VSZJ7i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from contextlib import closing | |
from datetime import datetime | |
import json | |
import MySQLdb | |
DB_NAME = 'x' | |
DB_USER = 'y' | |
DB_PASS = 'z' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PayPalPages(object): | |
def __init__(self, test, browser): | |
self.test = test | |
self.browser = browser | |
@contextmanager | |
def reload_if_paypal_cannot_get(self): | |
yield |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import random | |
@asyncio.coroutine | |
def print_whenever(identifier): | |
"""a little function that prints at random intervals""" | |
while True: | |
yield from asyncio.sleep(random.choice([0.5, 1, 1.3])) | |
print('hi from', identifier) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.mark.hookwrapper | |
def pytest_pyfunc_call(pyfuncitem): | |
yield | |
print('pyfunc call after') | |
if 'watch_logs' in pyfuncitem.funcargs: | |
print(pyfuncitem.funcargs['watch_logs']()) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ t2 py.test tests.py | |
============================= test session starts ============================= | |
platform linux -- Python 3.4.3 -- py-1.4.30 -- pytest-2.7.2 | |
rootdir: /tmp/t2, inifile: | |
collected 2 items | |
tests.py .F | |
================================== FAILURES =================================== | |
______________________________ test_should_fail _______________________________ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import pytest | |
def pytest_runtest_call(item): | |
if hasattr(item, "_request"): | |
if hasattr(item._request, "_addoutput_on_failure"): | |
item._request._addoutput_on_failure() | |
@pytest.fixture |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.yield_fixture | |
def print_on_fail(): | |
yield | |
print('test failed') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tempfile | |
from selenium import webdriver | |
htmlfile = tempfile.NamedTemporaryFile(suffix='.html', delete=False) | |
with htmlfile.file: | |
htmlfile.file.write('<!DOCTYPE html><html><input type="text" autocapitalize="off" /></html>') | |
def check_browser(browser): | |
browser.implicitly_wait(1) |