Skip to content

Commit

Permalink
fix IsolatedAsyncioTestCase import error on python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
musthafak committed Aug 28, 2023
1 parent c59c991 commit 0b2746e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install packages
run: |
export PYTHONIOENCODING=UTF8
pip install coveralls pytest-cov ptyprocess
pip install -r requirements-testing.txt
- name: Run tests
run: |
Expand Down
6 changes: 4 additions & 2 deletions requirements-testing.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pytest
pytest-cov
aiounittest; python_version < '3.8'
coverage
coveralls
ptyprocess
pytest
pytest-cov
7 changes: 6 additions & 1 deletion tests/PexpectTestCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
import sys
import os

try:
from unittest import IsolatedAsyncioTestCase
except ImportError:
from aiounittest import AsyncTestCase as IsolatedAsyncioTestCase


class _PexpectTestCaseBase:
def setUp(self):
Expand Down Expand Up @@ -115,5 +120,5 @@ class PexpectTestCase(_PexpectTestCaseBase, unittest.TestCase):
pass


class AsyncPexpectTestCase(_PexpectTestCaseBase, unittest.IsolatedAsyncioTestCase):
class AsyncPexpectTestCase(_PexpectTestCaseBase, IsolatedAsyncioTestCase):
pass

0 comments on commit 0b2746e

Please sign in to comment.