Mark existing tests as online
- Remove `offline` and `expensive` markers
This commit is contained in:
@@ -7,7 +7,7 @@ cache: pip
|
|||||||
before_install: pip install flit
|
before_install: pip install flit
|
||||||
# Use `--deps production` so that we don't install unnecessary dependencies
|
# Use `--deps production` so that we don't install unnecessary dependencies
|
||||||
install: flit install --deps production --extras test
|
install: flit install --deps production --extras test
|
||||||
script: pytest -m offline
|
script: pytest
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
|
@@ -1,10 +1,9 @@
|
|||||||
[pytest]
|
[pytest]
|
||||||
xfail_strict = true
|
xfail_strict = true
|
||||||
markers =
|
markers =
|
||||||
offline: Offline tests, aka. tests that can be executed without the need of a client
|
online: Online tests, aka. disabled tests...
|
||||||
expensive: Expensive tests, which should be executed sparingly
|
|
||||||
addopts =
|
addopts =
|
||||||
--strict-markers
|
--strict-markers
|
||||||
-m "not expensive"
|
-m "not online"
|
||||||
testpaths = tests
|
testpaths = tests
|
||||||
filterwarnings = error
|
filterwarnings = error
|
||||||
|
@@ -6,7 +6,6 @@ from os import path, environ
|
|||||||
from fbchat import FBchatException, Message, Client
|
from fbchat import FBchatException, Message, Client
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.offline
|
|
||||||
def test_examples():
|
def test_examples():
|
||||||
# Compiles the examples, to check for syntax errors
|
# Compiles the examples, to check for syntax errors
|
||||||
for name in glob(path.join(path.dirname(__file__), "../examples", "*.py")):
|
for name in glob(path.join(path.dirname(__file__), "../examples", "*.py")):
|
||||||
@@ -14,7 +13,7 @@ def test_examples():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.trylast
|
@pytest.mark.trylast
|
||||||
@pytest.mark.expensive
|
@pytest.mark.online
|
||||||
def test_login(client1):
|
def test_login(client1):
|
||||||
assert client1.is_logged_in()
|
assert client1.is_logged_in()
|
||||||
email = client1.email
|
email = client1.email
|
||||||
@@ -33,6 +32,7 @@ def test_login(client1):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.trylast
|
@pytest.mark.trylast
|
||||||
|
@pytest.mark.online
|
||||||
def test_sessions(client1):
|
def test_sessions(client1):
|
||||||
session = client1.get_session()
|
session = client1.get_session()
|
||||||
Client("no email needed", "no password needed", session_cookies=session)
|
Client("no email needed", "no password needed", session_cookies=session)
|
||||||
|
@@ -4,6 +4,8 @@ from os import path
|
|||||||
from fbchat import ThreadType, Message, Mention, EmojiSize, Sticker
|
from fbchat import ThreadType, Message, Mention, EmojiSize, Sticker
|
||||||
from utils import subset, STICKER_LIST, EMOJI_LIST
|
from utils import subset, STICKER_LIST, EMOJI_LIST
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.online
|
||||||
|
|
||||||
|
|
||||||
def test_fetch_all_users(client1):
|
def test_fetch_all_users(client1):
|
||||||
users = client1.fetch_all_users()
|
users = client1.fetch_all_users()
|
||||||
|
@@ -3,6 +3,8 @@ import pytest
|
|||||||
from fbchat import Message, MessageReaction
|
from fbchat import Message, MessageReaction
|
||||||
from utils import subset
|
from utils import subset
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.online
|
||||||
|
|
||||||
|
|
||||||
def test_set_reaction(client):
|
def test_set_reaction(client):
|
||||||
mid = client.send(Message(text="This message will be reacted to"))
|
mid = client.send(Message(text="This message will be reacted to"))
|
||||||
|
@@ -4,6 +4,8 @@ from fbchat import Plan, FBchatFacebookError, ThreadType
|
|||||||
from utils import random_hex, subset
|
from utils import random_hex, subset
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.online
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(
|
@pytest.fixture(
|
||||||
scope="module",
|
scope="module",
|
||||||
@@ -84,7 +86,7 @@ def test_edit_plan(client, thread, catch_event, compare, plan_data):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.trylast
|
@pytest.mark.trylast
|
||||||
@pytest.mark.expensive
|
@pytest.mark.skip
|
||||||
def test_on_plan_ended(client, thread, catch_event, compare):
|
def test_on_plan_ended(client, thread, catch_event, compare):
|
||||||
with catch_event("on_plan_ended") as x:
|
with catch_event("on_plan_ended") as x:
|
||||||
client.create_plan(Plan(int(time()) + 120, "Wait for ending"))
|
client.create_plan(Plan(int(time()) + 120, "Wait for ending"))
|
||||||
|
@@ -3,6 +3,8 @@ import pytest
|
|||||||
from fbchat import Poll, PollOption, ThreadType
|
from fbchat import Poll, PollOption, ThreadType
|
||||||
from utils import random_hex, subset
|
from utils import random_hex, subset
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.online
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(
|
@pytest.fixture(
|
||||||
scope="module",
|
scope="module",
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
|
import pytest
|
||||||
from fbchat import ThreadType
|
from fbchat import ThreadType
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.online
|
||||||
|
|
||||||
|
|
||||||
def test_search_for(client1):
|
def test_search_for(client1):
|
||||||
users = client1.search_for_users("Mark Zuckerberg")
|
users = client1.search_for_users("Mark Zuckerberg")
|
||||||
|
@@ -4,6 +4,8 @@ from os import path
|
|||||||
from fbchat import FBchatFacebookError, Message, Mention
|
from fbchat import FBchatFacebookError, Message, Mention
|
||||||
from utils import subset, STICKER_LIST, EMOJI_LIST, TEXT_LIST
|
from utils import subset, STICKER_LIST, EMOJI_LIST, TEXT_LIST
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.online
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("text", TEXT_LIST)
|
@pytest.mark.parametrize("text", TEXT_LIST)
|
||||||
def test_send_text(client, catch_event, compare, text):
|
def test_send_text(client, catch_event, compare, text):
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.online
|
||||||
|
|
||||||
|
|
||||||
def test_catch_event(client2, catch_event):
|
def test_catch_event(client2, catch_event):
|
||||||
mid = "test"
|
mid = "test"
|
||||||
|
@@ -4,6 +4,8 @@ from fbchat import Message, ThreadType, FBchatFacebookError, TypingStatus, Threa
|
|||||||
from utils import random_hex, subset
|
from utils import random_hex, subset
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.online
|
||||||
|
|
||||||
|
|
||||||
def test_remove_from_and_add_to_group(client1, client2, group, catch_event):
|
def test_remove_from_and_add_to_group(client1, client2, group, catch_event):
|
||||||
# Test both methods, while ensuring that the user gets added to the group
|
# Test both methods, while ensuring that the user gets added to the group
|
||||||
@@ -97,12 +99,7 @@ def test_change_image_remote(client1, group, catch_event):
|
|||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"color",
|
"color",
|
||||||
[
|
[x for x in ThreadColor if x in [ThreadColor.MESSENGER_BLUE, ThreadColor.PUMPKIN]],
|
||||||
x
|
|
||||||
if x in [ThreadColor.MESSENGER_BLUE, ThreadColor.PUMPKIN]
|
|
||||||
else pytest.param(x, marks=[pytest.mark.expensive()])
|
|
||||||
for x in ThreadColor
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
def test_change_color(client, catch_event, compare, color):
|
def test_change_color(client, catch_event, compare, color):
|
||||||
with catch_event("on_color_change") as x:
|
with catch_event("on_color_change") as x:
|
||||||
|
Reference in New Issue
Block a user