This file contains 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 sys, os | |
def main(): | |
try: | |
f1 = open('ff1.txt') | |
f2 = open('ff2.txt') | |
f3 = open('ff3.txt') | |
except IOError, e: | |
print "file open error", e | |
sys.exit(1) |
This file contains 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
@Override | |
public void onTestFailure(ITestResult iTestResult) { | |
try { | |
Object testCase = iTestResult.getInstance(); | |
Method testMethod = iTestResult.getMethod().getConstructorOrMethod().getMethod(); | |
logger.error("Fail: " + testMethod.getName(), iTestResult.getThrowable()); | |
invokeAnnotatedMethods(testCase, testMethod, AfterTestFailure.class); | |
} catch (Exception e) { |
This file contains 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
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:template match="/"> | |
<html> | |
<body> | |
<h1>total is <xsl:value-of select="test-results/@total"/></h1> | |
<h1>errors: <xsl:value-of select="test-results/@errors"/></h1> | |
<h1>failures <xsl:value-of select="test-results/@failures"/></h1> | |
<h1>time taken <xsl:value-of select="test-results/test-suite/@time"/></h1> | |
<table> |
This file contains 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
py.test --capture=no --browser=ff -n 3 --junitxml=junit.xml . |
This file contains 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
a = 1,2,"3",4,"5" | |
l = [] | |
for item in a: | |
l.append(int(item)*3) | |
print l[l.index(int(item)*3)]+10 |
This file contains 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 tst1 | |
from pack import tst2 | |
tst1.func("somethign") | |
reload (tst1) | |
tst2.func("somethign") | |
reload (tst2) |
This file contains 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
1. Пример | |
Текст текст | |
Текст текст | |
Текст текст | |
Текст текст | |
``` | |
def method(): | |
pass |
This file contains 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
py.test -n 2 . |
This file contains 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 | |
from random import randint | |
import logging | |
import pickle | |
logging.basicConfig(filename="log.log", level=logging.INFO) | |
class App(object): | |
def __init__(self): | |
self.a = randint(0, 100) |
This file contains 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 sys | |
import os | |
def main(): | |
usage = """ | |
You should pass at least 1 argument to %s | |
Arguments are folders full path separated by space. | |
""" % sys.argv[0] |
OlderNewer