Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Updatepytest-xdist Usage#4491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Bibo-Joshi merged 4 commits intomasterfrompytest-xdist
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions.github/workflows/unit_tests.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,7 +37,7 @@ jobs:
python -W ignore -m pip install -U pytest-cov
python -W ignore -m pip install .
python -W ignore -m pip install -r requirements-unit-tests.txt
python -W ignore -m pip install pytest-xdist[psutil]
python -W ignore -m pip install pytest-xdist

- name: Test with pytest
# We run 4 different suites here
Expand All@@ -63,10 +63,10 @@ jobs:
# Test the rest
export TEST_WITH_OPT_DEPS='true'
pip install .[all]
# `-n auto --distloadfile` uses pytest-xdist to runeach test fileona different CPU
#worker. Increasing number of workers has little effect on test duration, but it seems
# to increase flakyness, specially on python 3.7 with --dist=loadgroup.
pytest -v --cov --cov-append -n auto --distloadfile --junit-xml=.test_report_optionals_junit.xml
# `-n auto --distworksteal` uses pytest-xdist to runtestsonmultiple CPU
#workers. Increasing number of workers has little effect on test duration, but it seems
# to increase flakyness.
pytest -v --cov --cov-append -n auto --distworksteal --junit-xml=.test_report_optionals_junit.xml
main_status=$?
# exit with non-zero status if any of the two pytest runs failed
exit $(( ${opt_dep_status} || ${main_status} ))
Expand Down
21 changes: 1 addition & 20 deletionstests/test_bot.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3007,7 +3007,6 @@ async def test_edit_reply_markup(self, bot, message):
async def test_edit_reply_markup_inline(self):
pass

@pytest.mark.xdist_group("getUpdates_and_webhook")
# TODO: Actually send updates to the test bot so this can be tested properly
async def test_get_updates(self, bot):
await bot.delete_webhook() # make sure there is no webhook set if webhook tests failed
Expand DownExpand Up@@ -3074,7 +3073,6 @@ async def catch_timeouts(*args, **kwargs):
await bot.get_updates(read_timeout=read_timeout, timeout=timeout)
assert caught_read_timeout == expected

@pytest.mark.xdist_group("getUpdates_and_webhook")
@pytest.mark.parametrize("use_ip", [True, False])
# local file path as file_input is tested below in test_set_webhook_params
@pytest.mark.parametrize("file_input", ["bytes", "file_handle"])
Expand DownExpand Up@@ -3209,10 +3207,8 @@ async def test_send_game_default_protect_content(self, default_bot, chat_id, val
protected = await default_bot.send_game(chat_id, "test_game", protect_content=val)
assert protected.has_protected_content is val

@pytest.mark.xdist_group("game")
@xfail
async def test_set_game_score_1(self, bot, chat_id):
# NOTE: numbering of methods assures proper order between test_set_game_scoreX methods
async def test_set_game_score_and_high_scores(self, bot, chat_id):
# First, test setting a score.
game_short_name = "test_game"
game = await bot.send_game(chat_id, game_short_name)
Expand All@@ -3229,10 +3225,6 @@ async def test_set_game_score_1(self, bot, chat_id):
assert message.game.animation.file_unique_id == game.game.animation.file_unique_id
assert message.game.text != game.game.text

@pytest.mark.xdist_group("game")
@xfail
async def test_set_game_score_2(self, bot, chat_id):
# NOTE: numbering of methods assures proper order between test_set_game_scoreX methods
# Test setting a score higher than previous
game_short_name = "test_game"
game = await bot.send_game(chat_id, game_short_name)
Expand All@@ -3252,10 +3244,6 @@ async def test_set_game_score_2(self, bot, chat_id):
assert message.game.animation.file_unique_id == game.game.animation.file_unique_id
assert message.game.text == game.game.text

@pytest.mark.xdist_group("game")
@xfail
async def test_set_game_score_3(self, bot, chat_id):
# NOTE: numbering of methods assures proper order between test_set_game_scoreX methods
# Test setting a score lower than previous (should raise error)
game_short_name = "test_game"
game = await bot.send_game(chat_id, game_short_name)
Expand All@@ -3267,10 +3255,6 @@ async def test_set_game_score_3(self, bot, chat_id):
user_id=chat_id, score=score, chat_id=game.chat_id, message_id=game.message_id
)

@pytest.mark.xdist_group("game")
@xfail
async def test_set_game_score_4(self, bot, chat_id):
# NOTE: numbering of methods assures proper order between test_set_game_scoreX methods
# Test force setting a lower score
game_short_name = "test_game"
game = await bot.send_game(chat_id, game_short_name)
Expand All@@ -3295,9 +3279,6 @@ async def test_set_game_score_4(self, bot, chat_id):
game2 = await bot.send_game(chat_id, game_short_name)
assert str(score) in game2.game.text

@pytest.mark.xdist_group("game")
@xfail
async def test_get_game_high_scores(self, bot, chat_id):
# We need a game to get the scores for
game_short_name = "test_game"
game = await bot.send_game(chat_id, game_short_name)
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp