Skip to content
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

[ENG-2435] Upgrade pytest and others to fix broken tests #9551

Merged
merged 9 commits into from
Feb 5, 2021

Conversation

Johnetordoff
Copy link
Contributor

@Johnetordoff Johnetordoff commented Nov 24, 2020

Purpose

This is a booster shot of updated decencies for the OSF for pytest, these such keep us more up to date with the current test infrastructure and hopefully fix some probabilistic test fails.

You can read about the bug here which indicates updating pytest will fix the issue. I picked pytest 5.0.0 because it is recent and only requires few changes. The biggest change is pytest no long allows passing of fixtures the same way. Read about it here. So that had to be changed to release this.

Changes

  • update pytest and related dependencies
  • turn fixtures into functions to appease pytest update

QA Notes

Please make verification statements inspired by your code and what your code touches.

  • Verify that travis tests pass as expected

What are the areas of risk?

Any concerns/considerations/questions that development raised?

Documentation

Side Effects

None that I know of.

Ticket

https://openscience.atlassian.net/browse/ENG-2435

@Johnetordoff Johnetordoff force-pushed the update-testmon branch 4 times, most recently from 17677b4 to dfa0d35 Compare November 24, 2020 19:13
@Johnetordoff Johnetordoff force-pushed the update-testmon branch 3 times, most recently from bf60095 to 5ce53cf Compare November 24, 2020 20:21
@Johnetordoff Johnetordoff changed the title upgrade pytest and others [ENG-2435] Upgrade pytest and others to fix broken tests Dec 14, 2020
@pytest.mark.parametrize('sanction_fixture', [registration_approval, embargo, retraction])
def test_approve_after_reject_fails(self, sanction_fixture):
@pytest.mark.parametrize('sanction_object', [registration_approval, embargo, retraction])
def test_approve_after_reject_fails(self, sanction_object):
# using fixtures in parametrize returns the function
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: This comment is now unnecessary/misleading (in all locations)

@jwalz
Copy link
Contributor

jwalz commented Dec 17, 2020

Can you explain in the description why updating pytest fixed the test linked in the ticket? Also, more detail on what, specifically, pytest doesn't like about these fixtures now (seemingly it doesn't support using fixtures that aren't fully evaluated in test setup, a la via parametrize).

@Johnetordoff
Copy link
Contributor Author

@jwalz ok I made some comments in the description

 into update-testmon

# Conflicts:
#	osf_tests/test_registration_moderation_notifications.py
#	tests/test_registrations/test_review_flows.py
@@ -135,7 +135,6 @@ def test_rejection_flow(self, sanction_object, initial_state, end_state):

@pytest.mark.parametrize('sanction_object', [registration_approval, embargo, retraction])
def test_approve_after_reject_fails(self, sanction_object):
# using fixtures in parametrize returns the function
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not a huge deal, but if you could go through the file and delete all iterations of this comment, that would be appreciated

@jwalz jwalz merged commit eb66b68 into CenterForOpenScience:develop Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants