[svn r63913] make py.log.APIWARN available

--HG--
branch : trunk
This commit is contained in:
hpk 2009-04-09 22:32:04 +02:00
parent 73529ce63d
commit 2ffb68c177
7 changed files with 11 additions and 15 deletions

View File

@ -25,8 +25,8 @@ version = "1.0.0b1"
initpkg(__name__, initpkg(__name__,
description = "pylib and py.test: agile development and test support library", description = "pylib and py.test: agile development and test support library",
revision = int('$LastChangedRevision: 63896 $'.split(':')[1][:-1]), revision = int('$LastChangedRevision: 63913 $'.split(':')[1][:-1]),
lastchangedate = '$LastChangedDate: 2009-04-09 16:21:07 +0200 (Thu, 09 Apr 2009) $', lastchangedate = '$LastChangedDate: 2009-04-09 22:32:04 +0200 (Thu, 09 Apr 2009) $',
version = version, version = version,
url = "http://pylib.org", url = "http://pylib.org",
download_url = "http://codespeak.net/py/%s/download.html" % version, download_url = "http://codespeak.net/py/%s/download.html" % version,
@ -179,6 +179,7 @@ initpkg(__name__,
# logging API ('producers' and 'consumers' connected via keywords) # logging API ('producers' and 'consumers' connected via keywords)
'log.__doc__' : ('./log/__init__.py', '__doc__'), 'log.__doc__' : ('./log/__init__.py', '__doc__'),
'log.APIWARN' : ('./log/warning.py', 'APIWARN'),
'log.Producer' : ('./log/producer.py', 'Producer'), 'log.Producer' : ('./log/producer.py', 'Producer'),
'log.default' : ('./log/producer.py', 'default'), 'log.default' : ('./log/producer.py', 'default'),
'log._getstate' : ('./log/producer.py', '_getstate'), 'log._getstate' : ('./log/producer.py', '_getstate'),

View File

@ -2,7 +2,6 @@
import os, inspect, socket import os, inspect, socket
import sys import sys
from py.magic import autopath ; mypath = autopath() from py.magic import autopath ; mypath = autopath()
from py.__.misc.warn import APIWARN
try: try:
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
@ -165,7 +164,7 @@ class SshGateway(PopenCmdGateway):
cmdline[i] = "'" + cmdline[i].replace("'", "'\\''") + "'" cmdline[i] = "'" + cmdline[i].replace("'", "'\\''") + "'"
cmd = 'ssh -C' cmd = 'ssh -C'
if identity is not None: if identity is not None:
APIWARN("1.0", "pass in 'ssh_config' file instead of identity") py.log.APIWARN("1.0", "pass in 'ssh_config' file instead of identity")
cmd += ' -i %s' % (identity,) cmd += ' -i %s' % (identity,)
if ssh_config is not None: if ssh_config is not None:
cmd += ' -F %s' % (ssh_config) cmd += ' -F %s' % (ssh_config)

View File

@ -1,5 +1,5 @@
import py import py
from py.__.misc.warn import WarningPlugin from py.__.log.warning import WarningPlugin
mypath = py.magic.autopath() mypath = py.magic.autopath()
class TestWarningPlugin: class TestWarningPlugin:
@ -45,5 +45,4 @@ class TestWarningPlugin:
assert warning.msg == "xxx (since version 3.0)" assert warning.msg == "xxx (since version 3.0)"
def test_default(): def test_default():
from py.__.misc.warn import APIWARN assert py._com.comregistry.isregistered(py.log.APIWARN.im_self)
assert py._com.comregistry.isregistered(APIWARN.im_self)

View File

@ -5,7 +5,6 @@ module with base functionality for std.path package
from __future__ import generators from __future__ import generators
import os, sys import os, sys
import py import py
from py.__.misc.warn import APIWARN
def checktype(pathinstance, kw): def checktype(pathinstance, kw):
names = ('local', 'svnwc', 'svnurl', 'py', ) names = ('local', 'svnwc', 'svnurl', 'py', )
@ -22,7 +21,7 @@ class checker:
kwargs-specified specification. kwargs-specified specification.
""" """
def __init__(self, **kwargs): def __init__(self, **kwargs):
APIWARN("0.9.0", py.log.APIWARN("0.9.0",
"py.path.checker is deprecated, construct " "py.path.checker is deprecated, construct "
"calls to pathobj.check() instead", "calls to pathobj.check() instead",
) )

View File

@ -4,7 +4,6 @@ Collectors and test Items form a tree
that is usually built iteratively. that is usually built iteratively.
""" """
import py import py
from py.__.misc.warn import APIWARN
from py.__.test.outcome import Skipped from py.__.test.outcome import Skipped
def configproperty(name): def configproperty(name):
@ -442,7 +441,7 @@ class Directory(FSCollector):
def consider_dir(self, path, usefilters=None): def consider_dir(self, path, usefilters=None):
if usefilters is not None: if usefilters is not None:
APIWARN("0.99", "usefilters argument not needed") py.log.APIWARN("0.99", "usefilters argument not needed")
res = self.config.api.pytest_collect_recurse(path=path, parent=self) res = self.config.api.pytest_collect_recurse(path=path, parent=self)
if res is None or res: if res is None or res:
return self.config.api.pytest_collect_directory( return self.config.api.pytest_collect_directory(
@ -479,13 +478,13 @@ class Item(Node):
""" execute this test item.""" """ execute this test item."""
def warnoldcollect(): def warnoldcollect():
APIWARN("1.0", py.log.APIWARN("1.0",
"implement collector.collect() instead of " "implement collector.collect() instead of "
"collector.run() and collector.join()", "collector.run() and collector.join()",
stacklevel=2) stacklevel=2)
def warnoldtestrun(): def warnoldtestrun():
APIWARN("1.0", py.log.APIWARN("1.0",
"implement item.runtest() instead of " "implement item.runtest() instead of "
"item.run() and item.execute()", "item.run() and item.execute()",
stacklevel=2) stacklevel=2)

View File

@ -2,7 +2,6 @@ import py, os
from conftesthandle import Conftest from conftesthandle import Conftest
from py.__.test import parseopt from py.__.test import parseopt
from py.__.misc.warn import APIWARN
from py.__.test.runner import SetupState from py.__.test.runner import SetupState
def ensuretemp(string, dir=1): def ensuretemp(string, dir=1):
@ -181,7 +180,7 @@ class Config(object):
""" add a named group of options to the current testing session. """ add a named group of options to the current testing session.
This function gets invoked during testing session initialization. This function gets invoked during testing session initialization.
""" """
APIWARN("1.0", "define plugins to add options", stacklevel=2) py.log.APIWARN("1.0", "define plugins to add options", stacklevel=2)
group = self._parser.addgroup(groupname) group = self._parser.addgroup(groupname)
for opt in specs: for opt in specs:
group._addoption_instance(opt) group._addoption_instance(opt)