Skip to content

pytest migration for unit.common.test_Lenient#5822

Merged
pp-mo merged 3 commits into
SciTools:FEATURE_pytest_conversionfrom
bjlittle:pytest-common-lenient
Mar 13, 2024
Merged

pytest migration for unit.common.test_Lenient#5822
pp-mo merged 3 commits into
SciTools:FEATURE_pytest_conversionfrom
bjlittle:pytest-common-lenient

Conversation

@bjlittle

Copy link
Copy Markdown
Member

🚀 Pull Request

Description


Consult Iris pull request check list


Add any of the below labels to trigger actions on this PR:

  • benchmark_this Request that this pull request be benchmarked to check if it introduces performance shifts

@bjlittle bjlittle requested a review from pp-mo March 12, 2024 13:27
@bjlittle bjlittle added Type: Feature Branch Highlight this for a feature branch Feature: pytest labels Mar 12, 2024
@bjlittle

Copy link
Copy Markdown
Member Author

Interesting ... pytest-xdist is exposing failures elsewhere within CI 🤔

@bjlittle bjlittle force-pushed the pytest-common-lenient branch 2 times, most recently from 658ae4b to fc148b7 Compare March 12, 2024 14:34
@codecov

codecov Bot commented Mar 12, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.74%. Comparing base (fa86a4f) to head (fb6b96b).
Report is 9 commits behind head on FEATURE_pytest_conversion.

❗ Current head fb6b96b differs from pull request most recent head 8fc47ee. Consider uploading reports for the commit 8fc47ee to get more accurate results

Additional details and impacted files
@@                    Coverage Diff                     @@
##           FEATURE_pytest_conversion    #5822   +/-   ##
==========================================================
  Coverage                      89.74%   89.74%           
==========================================================
  Files                             92       92           
  Lines                          22940    22940           
  Branches                        5462     5462           
==========================================================
  Hits                           20588    20588           
  Misses                          1620     1620           
  Partials                         732      732           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bjlittle bjlittle marked this pull request as draft March 12, 2024 14:47
@bjlittle bjlittle force-pushed the pytest-common-lenient branch 5 times, most recently from 29fa164 to 305f081 Compare March 12, 2024 16:27
@bjlittle bjlittle force-pushed the pytest-common-lenient branch from 305f081 to 2df2ee0 Compare March 12, 2024 16:35
@bjlittle bjlittle marked this pull request as ready for review March 12, 2024 16:35
Comment thread lib/iris/tests/unit/common/lenient/test_Lenient.py

@pp-mo pp-mo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One definite bug, and some possible style queries to look into..

Comment thread lib/iris/tests/unit/common/lenient/test_Lenient.py
Comment thread lib/iris/tests/unit/common/lenient/test_Lenient.py Outdated
Comment thread lib/iris/tests/unit/common/lenient/test_Lenient.py Outdated
Comment thread lib/iris/tests/unit/common/lenient/test_Lenient.py Outdated
@pp-mo

pp-mo commented Mar 13, 2024

Copy link
Copy Markdown
Member

Sorry we just crossed over.
Please let me know when you're ready for me to re-check.

@bjlittle

Copy link
Copy Markdown
Member Author

@pp-mo Done, thanks ... back to you 👍

@pp-mo

pp-mo commented Mar 13, 2024

Copy link
Copy Markdown
Member

OK, good stuff!

@pp-mo pp-mo merged commit d0f4f2b into SciTools:FEATURE_pytest_conversion Mar 13, 2024
@bjlittle bjlittle deleted the pytest-common-lenient branch March 15, 2024 11:39
trexfeathers added a commit that referenced this pull request Nov 1, 2024
* Add pytest-mock dependency (#5811)

* Updated environment lockfiles

* added pytest iris class (#5808)

* added pytest iris class

* actioned majority of review comments

* converted remaining functions to camel_case

* actioned majority of review comments

* make unit/config pytest (#5810)

* Convert all tests to pytest.

* Don't use staticmethod on fixtures.

* Everything in 'TestConcatenate__dask' can use the same sample cubes.

* Spurious parentheses in 'pytest.fixture()'

* Convert all tests to pytest.

* Rewrite `result_path()` for pytest (#5817)

* Rewrite result_path.

* Review comments.

* Configure pytest-mock as pytest required-plugin (#5815)

* pytest migration ruff PT compliance for unit.concatenate (#5823)

* pytest migration for unit.common.test_Lenient (#5822)

* pytest migration for unit.common.lenient.test_Lenient

* assert order

* review actions

* Convert to pytest.

* Better implementation of `_shared_utils.results_path()` - using PyTest `request` (#5827)

* Rewrite result_path to use the pytest request fixture.

* More explicit guidance on the request fixture.

* Convert to pytest.

* Convert to pytest.

* Convert graphics testing conveniences to PyTest (#5832)

* PyTest-compatible check_graphic.

* Demonstrate new check_graphic in test_plot.

* 7c4f700

* Revert "7c4f7003a"

This reverts commit 68f81ac.

* Revert "Demonstrate new check_graphic in test_plot."

This reverts commit 7c4f700.

* Tidy up other unittest references in iris.tests.graphics.

* Tidy up other unittest references in iris.tests.graphics.

* check_graphic_caller docstring example.

* Make check_graphic_caller only accessible from conftest.

* Simplify data fixtures.

* Simplify data fixtures.

* Simplify data fixtures.

* Simplify Mock usage.

* Tidy equality checks.

* Convert to pytest,

* pytest migration for unit.common.lenient.test__lenient_client (#5842)

* pytest migration for unit.common.lenient.test__lenient_client

* review actions

* pytest migration for unit.common.lenient.test__Lenient (#5828)

* pytest migration for unit.common.lenient.test__Lenient

* ruff PT rule compliant

* fixes

* refactor

* assert fixes

* review actions

* Convert to pytest.

* Convert `tests/test_plot` to PyTest (#5839)

* Convert test_plot to PyTest.

* Add explanatory comments.

* Make ruff PT compliant.

* Convert test_quickplot.

* Test aggregate pytest (#5846)

* pytestify test_aggregate_by.

* pytestify test_lazy_aggregate_by.

* pytest migration for unit.common.lenient.test__lenient_service (#5843)

* pytest migration for unit.common.mixin.test__get_valid_standard_name (#5847)

* pytest migration for unit.common.mixin.test_CFVariableMixin (#5849)

* pytest migration for unit.common.lenient.test__qualname (#5845)

* pytest migration for unit.common.lenient.test__qualname

* use setup_method

* use setup fixture

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* pytest migration for unit.common.mixin.test_LimitedAttributeDict (#5851)

* pytest migration for unit.common.mixin.test_LimitedAttributeDict

* use setup_method

* use setup fixture

* pytest migration for unit.common.metadata.test_NamedTupleMeta (#5852)

* Make test_analysis PyTest (#5859)

* Fixes to _shared_utils.

* Make test_analysis.py pytest.

* Make test_analysis_calculus.py pytest.

* Remove np.testing.

* Convert to pytest.

* Convert unit/fileformats/__init__ code to pytest + move to pp_load_rules where it belongs.

* Convert unit/fileformats/pp_load_rules to pytest.

* converted cube directory tests to pytest (#5837)

* converted asserts to pytest

* pytestified and search replaced. Ruffed

* resolved old references

* refactored preexisting setup_methods into _setup

* further changes

* fixed mock and CML assert

* fixed cdl call in shared_utils

* all tests passing

* review changes

* tests passing

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Convert tests in unit/util to pytest (#5853)

* pytestify, and test__coord_regular

* search and replace

* ruff

* fixed most failures

* renamed result dir

* fixed review comments

* whoops, incorrectly called assert_original_metadata with request after removing it

* corrected assert

* Use mocker.spy in place of mock.patch.

* pytest migration for unit.common.metadata.test_AncillaryVariableMetadata (#5854)

* pytest migration for unit.common.metadata.test_AncillaryVariableMetadata

* use setup fixture

* review actions

* Convert `unit.plot` and `.quickplot` to PyTest (#5866)

* Convert tests.unit.plot to PyTest.

* Convert tests.unit.quickplot to PyTest.

* Convert setups to autouse fixtures.

* Convert to Pytest.

* Convert to Pytest.

* Convert to pytest.

* Convert to pytest, move test_rules into /rules.

* Convert to pytest

* Convert remaining graphics tests to PyTest (#5867)

* Convert test_mapping to PyTest.

* Convert integration.plot to PyTest.

* Convert unit/fileformats/structured_array_identification to pytest.

* Review changes.

* pytest migration for unit.common.metadata.test_BaseMetadata (#5868)

* pytest migration for unit.common.metadata.test_BaseMetadata

* review actions

* pytest migration of unit.common.metadata.test_hexdigest (#5874)

* pytest migration of unit.common.metadata.test_metadata_filter (#5875)

* pytest migration for unit.common.metadata.test_CubeMetadata (#5881)

* pytest migration of unit.common.metadata.test_metadata_manager_factory (#5876)

* pytest migration of unit.common.metadata.test_metadata_manager_factory

* review actions

* More root pytest (#5883)

* Convert root test_util to PyTest.

* Convert root test_pp to PyTest.

* Review comments - make tests easier to understand.

* pytest migration of unit.common.metadata.test_CellMeasureMetadata (#5878)

* pytest migration of unit.common.metadata.test_CellMeasureMetadata

* Update lib/iris/tests/unit/common/metadata/test_CellMeasureMetadata.py

Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk>

* Update lib/iris/tests/unit/common/metadata/test_CellMeasureMetadata.py

Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk>

* Update lib/iris/tests/unit/common/metadata/test_CellMeasureMetadata.py

Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk>

* Update lib/iris/tests/unit/common/metadata/test_CellMeasureMetadata.py

Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk>

* review actions

---------

Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk>

* pytest migration of unit.common.metadata.test_CoordMetadata (#5880)

* pytest migration of unit.common.metadata.test_CoordMetadata

* review actions

* Update lib/iris/tests/unit/common/metadata/test_CoordMetadata.py

Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk>

---------

Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk>

* pytest migration of unit.common.resolve.test_Resolve (#5882)

* pytest migration of unit.common.resolve.test_Resolve

* review actions

* regen lockfiles

* precommit fixes

* fix some test failures

* Added a style guide for iris pytest (#5785)

* Added a draft style guide for iris pytest

* most review comments

* refactored documentation

* fixed doclinks

* reslolved review comments

* removed excess pages

* conversion checklist

* pre-lunch changes

* majority review requests, rough reshuffle of Test Categories

* further reshuffle of Test Categories

* review stuffies

* fixed a coup of review comments

* fixed a doctest failures

* reworded function and class intros

---------

Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com>

* added whatsnew entries (#6211)

* added whatsnew entries

* corrected _ to - in githubname

* whatsnew corrections

---------

Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com>

---------

Co-authored-by: Bill Little <bill.james.little@gmail.com>
Co-authored-by: Lockfile bot <noreply@github.com>
Co-authored-by: stephenworsley <49274989+stephenworsley@users.noreply.github.com>
Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk>
Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Wright <henrywright@sky.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature: pytest Type: Feature Branch Highlight this for a feature branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants