Skip to content

Commit 1e601da

Browse files
Update tests
1 parent 01a693d commit 1e601da

File tree

6 files changed

+8
-11
lines changed

6 files changed

+8
-11
lines changed

.github/workflows/python-app.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ jobs:
8383
working-directory: tests
8484
run: |
8585
python -m pip install -r ../requirements-dev.txt
86-
python3 -m pytest -s -x test_testnet.py -k test_hello
86+
python3 -m pytest -s -x test_testnet2.py -k test_hello
87+
python3 -m pytest -s -x test_testnet2.py -k test_deposit
88+
python3 -m pytest -s -x test_mixin_api.py
8789
- name: auditwheel repair
8890
if: ${{ matrix.os == 'ubuntu-18.04' }}
8991
id: manylinuxwhlfile

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# content of conftest.py
22
import pytest
3+
import asyncio
34

45
def pytest_addoption(parser):
56
parser.addoption("--newtestnet", action="store_true", help="Create a fresh new testnet")

tests/start_testnet.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,4 @@ async def start():
4646
print(f'++++++++node {i+1} down')
4747
time.sleep(3.0)
4848

49-
loop = asyncio.get_event_loop()
50-
loop.run_until_complete(start())
49+
asyncio.run(start())

tests/test_filter_multisig.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def setup_class(cls):
5454
logger.info('++++++')
5555
cls.api = MixinApi('http://127.0.0.1:8001')
5656

57-
loop = asyncio.get_event_loop()
5857
async def wait():
5958
api = MixinApi('http://127.0.0.1:8007')
6059
await asyncio.sleep(1.5)
@@ -65,7 +64,7 @@ async def wait():
6564
except Exception as e:
6665
await asyncio.sleep(0.5)
6766
logger.info(e)
68-
loop.run_until_complete(wait())
67+
asyncio.run(wait())
6968
logger.info("++++setup_class return")
7069

7170
@classmethod

tests/test_testnet.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def setup_class(cls):
2525

2626
cls.api = MixinApi('http://127.0.0.1:8001')
2727

28-
loop = asyncio.get_event_loop()
2928
async def wait():
3029
api = MixinApi('http://127.0.0.1:8007')
3130
await asyncio.sleep(2)
@@ -36,7 +35,7 @@ async def wait():
3635
except Exception as e:
3736
await asyncio.sleep(0.5)
3837
logger.info(e)
39-
loop.run_until_complete(wait())
38+
asyncio.run(wait())
4039

4140
@classmethod
4241
def teardown_class(cls):

tests/test_testnet2.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def setup_class(cls):
5454
logger.info('++++++')
5555
cls.api = MixinApi('http://127.0.0.1:8001')
5656

57-
loop = asyncio.get_event_loop()
5857
async def wait():
5958
api = MixinApi('http://127.0.0.1:8007')
6059
await asyncio.sleep(1.5)
@@ -65,7 +64,7 @@ async def wait():
6564
except Exception as e:
6665
await asyncio.sleep(0.5)
6766
logger.info(e)
68-
loop.run_until_complete(wait())
67+
asyncio.run(wait())
6968
logger.info("++++setup_class return")
7069

7170
@classmethod
@@ -82,8 +81,6 @@ def teardown_method(self, method):
8281

8382
@pytest.mark.asyncio
8483
async def test_hello(self):
85-
if self.auto_start_testnet:
86-
logger.info(self.testnet.config_dirs)
8784
await asyncio.sleep(1.0)
8885
info = await self.api.get_info()
8986
# for key in info:

0 commit comments

Comments
 (0)