Created
December 4, 2015 21:59
-
-
Save foxx/8bab6b18194203e5b219 to your computer and use it in GitHub Desktop.
Coderpad pytest support
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 os | |
import sys | |
import subprocess | |
def sanitypatch(): | |
""" | |
Quick hack to install any package we want in coderpad... | |
Because real coders use pytest, amirite? | |
""" | |
print("applying coderpad sanity patch...") | |
packages = ' '.join(['pytest']) | |
dst = os.path.expanduser("~/.local/lib/python3.4/site-packages") | |
cmd = "pip3 install --user {} > /dev/null".format(packages) | |
os.system(cmd) | |
sys.path.append(dst) | |
print("sanity restored") | |
print("\r\n\r\n") | |
def main(): | |
args = ['--tb=native', '-s', '-q', __file__] | |
#args.insert(0, '--pdb') | |
pytest.main(args) | |
sanitypatch() | |
import pytest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment