Arrange files like this:
apple/
__init__.py
apple.py
tests/
test_everything.py
| Seed: 173015 | |
| 0 X 1 | |
| 1 X 1 | |
| 0 X 2 | |
| 1 X 1 | |
| 2 X 1 | |
| 1 X 1 | |
| 1 X 3 | |
| 2 X 2 |
| import pytest, sys | |
| sys.exit(pytest.main()) |
Arrange files like this:
apple/
__init__.py
apple.py
tests/
test_everything.py
| # original from: http://pythontesting.net/framework/pytest/pytest-expect-plugin-1 | |
| import pytest | |
| import inspect | |
| import os.path | |
| @pytest.fixture | |
| def expect(request): | |
| def do_expect(expr, msg=''): | |
| if not expr: | |
| _log_failure(request.node, msg) |
| from PIL import ImageChops, ImageDraw, Image | |
| import pytest | |
| import os | |
| import py.path | |
| import math | |
| import operator | |
| def rms_diff(im1, im2): | |
| """Calculate the root-mean-square difference between two images | |
| Taken from: http://snipplr.com/view/757/compare-two-pil-images-in-python/ |
| from __future__ import unicode_literals | |
| import weakref | |
| from coilib50 import unittest | |
| class Test(unittest.TestCase): | |
| _TESTS = [] | |
| def test_01(self): | |
| Test._TESTS.append(weakref.ref(self)) |
| import os | |
| import fnmatch | |
| import sys | |
| directory = sys.argv[1] | |
| for root, dirs, names in os.walk(sys.argv[1]): | |
| for name in names: | |
| if fnmatch.fnmatch(name, 'pytest_*.py') and os.path.basename(root) == '_tests': | |
| source = os.path.join(root, name) |
| import requests | |
| auth = ('nicoddemus', 'XXXX') | |
| for issue_id in xrange(1, 768+1): | |
| url = 'https://bitbucket.org/api/1.0/repositories/{accountname}/{repo_slug}/issues/{issue_id}/comments' | |
| url = url.format(accountname='pytest-dev', repo_slug='pytest', issue_id=issue_id) | |
| print '-' *10, issue_id | |
| data = { | |
| "content": "This issue has been moved to GitHub: https://github.com/pytest-dev/pytest/issues/{issue_id}".format(issue_id=issue_id), | |
| } |
| import types | |
| import unittest | |
| from _pytest.unittest import TestCaseFunction | |
| import pytest | |
| class LoadTestsSuiteCollector(pytest.Collector): | |
| def __init__(self, name, parent, suite): |