pytester: typing

This commit is contained in:
Daniel Hahler
2019-10-22 00:05:02 +02:00
parent cbc39dd86e
commit 886a3ad609
2 changed files with 52 additions and 21 deletions

View File

@@ -395,6 +395,27 @@ def test_testdir_subprocess(testdir):
assert testdir.runpytest_subprocess(testfile).ret == 0
def test_testdir_subprocess_via_runpytest_arg(testdir) -> None:
testfile = testdir.makepyfile(
"""
def test_testdir_subprocess(testdir):
import os
testfile = testdir.makepyfile(
\"""
import os
def test_one():
assert {} != os.getpid()
\""".format(os.getpid())
)
assert testdir.runpytest(testfile).ret == 0
"""
)
result = testdir.runpytest_subprocess(
"-p", "pytester", "--runpytest", "subprocess", testfile
)
assert result.ret == 0
def test_unicode_args(testdir):
result = testdir.runpytest("-k", "💩")
assert result.ret == ExitCode.NO_TESTS_COLLECTED