kopia lustrzana https://github.com/halcy/Mastodon.py
try to workaround streaming test failures on CI
rodzic
26c1133395
commit
3e37d0c345
|
@ -10,14 +10,19 @@ import time
|
||||||
|
|
||||||
import select
|
import select
|
||||||
|
|
||||||
# For monkeypatching so we can make vcrpy better
|
|
||||||
import vcr.stubs
|
|
||||||
|
|
||||||
streaming_is_patched = False
|
streaming_is_patched = False
|
||||||
real_connections = []
|
real_connections = []
|
||||||
close_connections = False
|
close_connections = False
|
||||||
|
|
||||||
|
@pytest.fixture(scope='module')
|
||||||
|
def vcr(vcr):
|
||||||
|
vcr.match_on = ['path']
|
||||||
|
return vcr
|
||||||
|
|
||||||
def patch_streaming():
|
def patch_streaming():
|
||||||
|
# For monkeypatching so we can make vcrpy better
|
||||||
|
import vcr.stubs
|
||||||
|
|
||||||
global streaming_is_patched
|
global streaming_is_patched
|
||||||
global close_connections
|
global close_connections
|
||||||
if streaming_is_patched is True:
|
if streaming_is_patched is True:
|
||||||
|
@ -377,7 +382,7 @@ def test_stream_user_direct(api, api2, api3):
|
||||||
@pytest.mark.vcr(match_on=['path'])
|
@pytest.mark.vcr(match_on=['path'])
|
||||||
def test_stream_user_local(api, api2):
|
def test_stream_user_local(api, api2):
|
||||||
patch_streaming()
|
patch_streaming()
|
||||||
|
|
||||||
# Make sure we are in the right state to not receive updates from api2
|
# Make sure we are in the right state to not receive updates from api2
|
||||||
user = api2.account_verify_credentials()
|
user = api2.account_verify_credentials()
|
||||||
api.account_unfollow(user)
|
api.account_unfollow(user)
|
||||||
|
|
Ładowanie…
Reference in New Issue