introduce new --testpkg importpath option, add more meat to draft release announcement

This commit is contained in:
holger krekel
2010-11-06 22:17:33 +01:00
parent 1a7f2e77e8
commit 707775dcfa
7 changed files with 204 additions and 54 deletions

View File

@@ -309,3 +309,24 @@ class TestInvocationVariants:
out, err = capsys.readouterr()
assert "--myopt" in out
def test_cmdline_python_package(self, testdir):
path = testdir.mkpydir("tpkg")
path.join("test_hello.py").write("def test_hello(): pass")
path.join("test_world.py").write("def test_world(): pass")
result = testdir.runpytest("--pyargs", "tpkg")
assert result.ret == 0
result.stdout.fnmatch_lines([
"*2 passed*"
])
result = testdir.runpytest("--pyargs", "tpkg.test_hello")
assert result.ret == 0
result.stdout.fnmatch_lines([
"*1 passed*"
])
def test_cmdline_python_package_not_exists(self, testdir):
result = testdir.runpytest("--pyargs", "tpkgwhatv")
assert result.ret
result.stderr.fnmatch_lines([
"ERROR*file*or*package*not*found*",
])