reintroduce py.test.cmdline.main() (alias for py.cmdline.pytest())
resolves issue #61 --HG-- branch : trunk
This commit is contained in:
parent
41a572ee1e
commit
3adf6687c9
|
@ -1,12 +1,13 @@
|
|||
Changes between 1.1.1 and 1.1.0
|
||||
=====================================
|
||||
|
||||
- re-introduce py.test.cmdline.main for backward compatibility
|
||||
|
||||
- fix a bug with path.check(versioned=True) for svn paths
|
||||
|
||||
- try harder to have deprecation warnings for py.compat.* accesses
|
||||
report a correct location
|
||||
|
||||
|
||||
Changes between 1.1.0 and 1.0.2
|
||||
=====================================
|
||||
|
||||
|
|
|
@ -429,13 +429,3 @@ name. Given a filesystem ``fspath`` it is constructed as follows:
|
|||
* perform ``sys.path.insert(0, basedir)``.
|
||||
|
||||
* import the root package as ``root``
|
||||
|
||||
* determine the fully qualified name for ``fspath`` by either:
|
||||
|
||||
* calling ``root.__pkg__.getimportname(fspath)`` if the
|
||||
``__pkg__`` exists.` or
|
||||
|
||||
* otherwise use the relative path of the module path to
|
||||
the base dir and turn slashes into dots and strike
|
||||
the trailing ``.py``.
|
||||
|
||||
|
|
|
@ -68,6 +68,9 @@ py.apipkg.initpkg(__name__, dict(
|
|||
'Function' : '.impl.test.pycollect:Function',
|
||||
'_fillfuncargs' : '.impl.test.funcargs:fillfuncargs',
|
||||
},
|
||||
'cmdline': {
|
||||
'main' : '.impl.test.cmdline:main', # backward compat
|
||||
},
|
||||
},
|
||||
|
||||
# hook into the top-level standard library
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
import py
|
||||
|
||||
def main():
|
||||
py.test.cmdline.main()
|
||||
def main(args):
|
||||
py.test.cmdline.main(args)
|
||||
|
|
|
@ -56,3 +56,16 @@ def test_importorskip_imports_last_module_part():
|
|||
ospath = py.test.importorskip("os.path")
|
||||
assert os.path == ospath
|
||||
|
||||
|
||||
def test_pytest_cmdline_main(testdir):
|
||||
p = testdir.makepyfile("""
|
||||
import sys
|
||||
sys.path.insert(0, %r)
|
||||
import py
|
||||
def test_hello():
|
||||
assert 1
|
||||
if __name__ == '__main__':
|
||||
py.test.cmdline.main([__file__])
|
||||
""" % (str(py._dir.dirpath())))
|
||||
import subprocess
|
||||
subprocess.check_call([sys.executable, str(p)])
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
from py.test import raises
|
||||
import py
|
||||
import sys
|
||||
import inspect
|
||||
|
Loading…
Reference in New Issue