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
def test_monkeypatch_context_processor_with_exception(monkeypatch): | |
monkeypatch = MonkeyPatch() | |
class TerribleException(Exception): | |
pass | |
@staticmethod | |
def _func(): | |
raise TerribleException('terrible!') | |
mp.setattr(SampleNew, 'hello', _func) |
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
def test_monkeypatch_context_processor_with_exception(monkeypatch): | |
class TerribleException(Exception): | |
pass | |
@staticmethod | |
def _func(): | |
raise TerribleException('terrible!') | |
monkeypatch.setattr(SampleNew, 'hello', _func) | |
with pytest.raises(TerribleException): |
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
devpi.localhost - - [26/May/2014 10:45:21] "GET /+search?query=devpi+use++path%3A%2Fhpk%2Fdev%2Fdevpi&page=1 HTTP/1.1" 500 59 | |
Traceback (most recent call last): | |
File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run | |
self.result = application(self.environ, self.start_response) | |
File "/home/hpk/venv/0/local/lib/python2.7/site-packages/pyramid/router.py", line 242, in __call__ | |
response = self.invoke_subrequest(request, use_tweens=True) | |
File "/home/hpk/venv/0/local/lib/python2.7/site-packages/pyramid/router.py", line 217, in invoke_subrequest | |
response = handle_request(request) | |
File "/home/hpk/venv/0/local/lib/python2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween | |
response = handler(request) |
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
def devpiserver_auth(userconfig, user, password): | |
# if we know about the user and password is correct | |
return dict(status="ok", groups=[...]) | |
# if we know about the user and the password is incorrect | |
return dict(status="reject") | |
# if we don't know about the user | |
# other plugins may still try verification | |
return dict(status="unknown") |
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
[tox] | |
envlist = py27-{threads,greenlets} | |
[testenv] | |
commands = echo {envname} |
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
def add_method_wrapper(cls, wrapper_func): | |
""" Substitute the function named "wrapperfunc.__name__" at class | |
"cls" with a function that wraps the call to the original function. | |
Return an undo function which can be called to reset the class to use | |
the old method again. | |
wrapper_func is called with the same arguments as the method | |
it wraps and its result is used as a wrap_controller for | |
calling the original function. | |
""" |
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
+def get_name_version_doczip(path): | |
+ path = str(path) | |
+ DOCZIPSUFFIX = ".doc.zip" | |
+ assert path.endswith(DOCZIPSUFFIX) | |
+ fn = path[:-len(DOCZIPSUFFIX)] | |
+ # for documentation we presume that versions do not contain "-" | |
+ name, version = re.match("(.*)-([a-zA-Z0-9\.!]+)", fn).groups() | |
+ return name, version |
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
if self.name_version: | |
name, version = self.name_version | |
else: | |
name, version = pkginfo.name, pkginfo.version |
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
Collecting devpi-common<2.1,>=2.0.6.dev2 (from devpi-server==2.2.0.dev1) | |
Could not find a version that satisfies the requirement devpi-common<2.1,>=2.0.6.dev2 (from devpi-server==2.2.0.dev1) (from versions: 1.2, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6.dev2) |
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
from setuptools import setup | |
if __name__ == "__main__": | |
setup( | |
name='pytest-pep8', | |
description='pytest plugin to check PEP8 requirements', | |
long_description=open("README.txt").read(), | |
license="MIT license", | |
version='1.0.7.dev1', | |
author='Holger Krekel and Ronny Pfannschmidt', |
OlderNewer