Skip to content

Ordering of tests #223

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 16, 2019
Merged

Ordering of tests #223

merged 3 commits into from
Mar 16, 2019

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Mar 29, 2015

This is for #214.

TODO:

  • optimize (inline calls for ordering; rename)
  • allow to skip this (config setting?)

@landscape-bot
Copy link

Code Health
Repository health decreased by 0.34% when pulling 480f361 on blueyed:order-of-tests into 0ec741b on pytest-dev:master.

@blueyed
Copy link
Contributor Author

blueyed commented May 16, 2017

Squashed/rebased.

@blueyed
Copy link
Contributor Author

blueyed commented Dec 25, 2017

Should/could get improved based on #214 (comment).

@codecov-io
Copy link

codecov-io commented Dec 25, 2017

Codecov Report

Merging #223 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #223      +/-   ##
========================================
- Coverage   98.03%    98%   -0.04%     
========================================
  Files          32     32              
  Lines        1831   1853      +22     
  Branches      142    147       +5     
========================================
+ Hits         1795   1816      +21     
- Misses         23     24       +1     
  Partials       13     13
Flag Coverage Δ
#dj110 85.75% <100%> (+0.17%) ⬆️
#dj111 88.01% <100%> (+0.14%) ⬆️
#dj18 86.72% <100%> (+0.15%) ⬆️
#dj19 85.75% <100%> (+0.11%) ⬆️
#dj20 87.96% <100%> (+0.14%) ⬆️
#dj21 85.48% <100%> (+0.17%) ⬆️
#dj22 83.37% <100%> (+0.19%) ⬆️
#djmaster 81.38% <100%> (+0.22%) ⬆️
#mysql_innodb 86.23% <100%> (+0.16%) ⬆️
#mysql_myisam 86.07% <100%> (+0.16%) ⬆️
#postgres 91.2% <100%> (+0.1%) ⬆️
#py27 91.04% <100%> (+0.1%) ⬆️
#py34 85.75% <100%> (+0.11%) ⬆️
#py35 85.75% <100%> (+0.17%) ⬆️
#py36 88.88% <100%> (+0.13%) ⬆️
#py37 85.86% <100%> (+0.16%) ⬆️
#pytest41 85.21% <100%> (+0.17%) ⬆️
#sqlite 90.39% <100%> (+0.06%) ⬆️
#sqlite_file 85.75% <100%> (+0.11%) ⬆️
#xdist 87.96% <100%> (+0.14%) ⬆️
Impacted Files Coverage Δ
tests/test_db_setup.py 100% <100%> (ø) ⬆️
pytest_django/plugin.py 94.02% <100%> (+0.27%) ⬆️
pytest_django_test/db_helpers.py 98.98% <0%> (-1.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f55c709...9df4d2e. Read the comment docs.

blueyed added 2 commits March 13, 2019 23:42
This uses `pytest_collection_modifyitems` to order the tests.

Fixes pytest-dev#214.
@blueyed blueyed merged commit 5a79fba into pytest-dev:master Mar 16, 2019
@blueyed blueyed deleted the order-of-tests branch March 16, 2019 02:06
callahad added a commit to callahad/pytest-django that referenced this pull request Feb 27, 2020
Pytest-django 3.5.0 attempts to run tests in the same order as Django:
Issue pytest-dev#223, Commit 5a79fba

Pytest itself can re-order tests to prioritize previously failed tests
(--failed-first), incremental runs of the test suite (--stepwise), etc.
However, pytest-django's re-ordering clobbers pytest's, which can break
those options as reported in pytest-dev#819.

By applying the @pytest.hookimpl(tryfirst=True) decorator to
pytest_collection_modifyitems(), pytest-django's re-ordering happens
first, and nolonger clobbers the later re-ordering performed by pytest.

Fixes pytest-dev#819
callahad added a commit to callahad/pytest-django that referenced this pull request Feb 27, 2020
Pytest-django 3.5.0 attempts to run tests in the same order as Django:
Issue pytest-dev#223, Commit 5a79fba

Pytest itself can re-order tests to prioritize previously failed tests
(--failed-first), incremental runs of the test suite (--stepwise), etc.
However, pytest-django's re-ordering clobbers pytest's, which can break
those options as reported in pytest-dev#819.

By applying the @pytest.hookimpl(tryfirst=True) decorator to
pytest_collection_modifyitems(), pytest-django's re-ordering happens
first, and does not clobber the later re-ordering performed by pytest.

Fixes pytest-dev#819
blueyed pushed a commit that referenced this pull request Feb 28, 2020
Pytest-django 3.5.0 attempts to run tests in the same order as Django:
Issue #223, Commit 5a79fba

Pytest itself can re-order tests to prioritize previously failed tests
(--failed-first), incremental runs of the test suite (--stepwise), etc.
However, pytest-django's re-ordering clobbers pytest's, which can break
those options as reported in #819.

By applying the @pytest.hookimpl(tryfirst=True) decorator to
pytest_collection_modifyitems(), pytest-django's re-ordering happens
first, and does not clobber the later re-ordering performed by pytest.

Fixes #819
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants