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
if self.name_version: | |
name, version = self.name_version | |
else: | |
name, version = pkginfo.name, pkginfo.version |
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
+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 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
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 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
[tox] | |
envlist = py27-{threads,greenlets} | |
[testenv] | |
commands = echo {envname} |
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
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 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
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 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
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 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
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 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
actionid=py34 | |
msg=getenv | |
cmdargs=['C:\\Users\\Administrator\\0\\Scripts\\virtualenv.EXE', '--setuptools', '--python', 'c:\\python34\\python.exe', 'py34'] | |
env={'TMP': 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\2', 'COMPUTERNAME': 'WIN2', '_OLD_VIRTUAL_PATH': 'C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;c:\\\\python27;c:\\\\python27\\scripts', 'USERDOMAIN': 'WIN2', 'PSMODULEPATH': 'C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\', 'COMMONPROGRAMFILES': 'C:\\Program Files\\Common Files', 'PROCESSOR_IDENTIFIER': 'Intel64 Family 6 Model 45 Stepping 7, GenuineIntel', 'PROGRAMFILES': 'C:\\Program Files', 'PROCESSOR_REVISION': '2d07', 'SYSTEMROOT': 'C:\\Windows', 'PATH': 'c:\\users\\admini~1\\appdata\\local\\temp\\2\\devpi-test3\\pytest-2.5.2.dev1\\.tox\\py34\\Scripts;C:\\Users\\Administrator\\0\\Scripts;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\Wind |
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
diff --git a/_pytest/python.py b/_pytest/python.py | |
--- a/_pytest/python.py | |
+++ b/_pytest/python.py | |
@@ -594,12 +594,14 @@ class CallSpec2(object): | |
self._globalparam = _notexists | |
self._arg2scopenum = {} # used for sorting parametrized resources | |
self.keywords = {} | |
+ self.indices = {} | |
def copy(self, metafunc): |