Skip to content

TST: Use more pytest fixtures #53679

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 4 commits into from
Jun 20, 2023
Merged

Conversation

mroeschke
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Jun 14, 2023
@mroeschke mroeschke added this to the 2.1 milestone Jun 14, 2023
"data", [int_data, uint_data, float_data, bool_data, datetime_data]
"data",
[
lambda: random.randint(-100, 100),
Copy link
Member

Choose a reason for hiding this comment

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

Just want to be sure - I think the use of the lambda ensures that test collection is deterministic, is that right?

Copy link
Member Author

Choose a reason for hiding this comment

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

The lambda here just makes the data generation lazy and not evaluated during the test collection phase, so the data isn't necessarily deterministic.

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

lgtm

@mroeschke mroeschke merged commit 54af661 into pandas-dev:main Jun 20, 2023
@mroeschke mroeschke deleted the test/fixtures branch June 20, 2023 17:10
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
* TST: Use more pytest fixtures

* Fix sql fixture

* More test fixtures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants