File: test_subprocess.py

package info (click to toggle)
python-pytest-asyncio 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 616 kB
  • sloc: python: 2,421; makefile: 24; sh: 1
file content (17 lines) | stat: -rw-r--r-- 401 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""Tests for using subprocesses in tests."""

from __future__ import annotations

import asyncio.subprocess
import sys

import pytest


@pytest.mark.asyncio
async def test_subprocess():
    """Starting a subprocess should be possible."""
    proc = await asyncio.subprocess.create_subprocess_exec(
        sys.executable, "--version", stdout=asyncio.subprocess.PIPE
    )
    await proc.communicate()