mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 10:16:27 +00:00
skip async tests on old python versions
This commit is contained in:
parent
3fd89e1bb2
commit
77758cff93
@ -1,5 +1,6 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import io
|
import io
|
||||||
|
import sys
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
@ -46,6 +47,7 @@ class TestReadFile:
|
|||||||
with pytest.raises(Exception, match="Invalid readfile filter"):
|
with pytest.raises(Exception, match="Invalid readfile filter"):
|
||||||
tctx.configure(rf, readfile_filter="~~")
|
tctx.configure(rf, readfile_filter="~~")
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.version_info < (3, 8), reason='requires Python 3.8 or higher')
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_read(self, tmpdir, data, corrupt_data):
|
async def test_read(self, tmpdir, data, corrupt_data):
|
||||||
rf = readfile.ReadFile()
|
rf = readfile.ReadFile()
|
||||||
@ -93,6 +95,7 @@ class TestReadFile:
|
|||||||
|
|
||||||
|
|
||||||
class TestReadFileStdin:
|
class TestReadFileStdin:
|
||||||
|
@pytest.mark.skipif(sys.version_info < (3, 8), reason='requires Python 3.8 or higher')
|
||||||
@mock.patch('sys.stdin')
|
@mock.patch('sys.stdin')
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_stdin(self, stdin, data, corrupt_data):
|
async def test_stdin(self, stdin, data, corrupt_data):
|
||||||
@ -108,6 +111,7 @@ class TestReadFileStdin:
|
|||||||
with pytest.raises(exceptions.FlowReadException):
|
with pytest.raises(exceptions.FlowReadException):
|
||||||
await rf.load_flows(stdin.buffer)
|
await rf.load_flows(stdin.buffer)
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.version_info < (3, 8), reason='requires Python 3.8 or higher')
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_normal(self, tmpdir, data):
|
async def test_normal(self, tmpdir, data):
|
||||||
rf = readfile.ReadFileStdin()
|
rf = readfile.ReadFileStdin()
|
||||||
|
Loading…
Reference in New Issue
Block a user