Skip to content

Conversation

NoahStapp
Copy link
Contributor

No description provided.

@NoahStapp NoahStapp changed the title PYTHON-3738 Use tox for sphinx doc instead of setup.py PYTHON-3727 Use tox for unit tests and switch to pytest Jun 20, 2023
@blink1073
Copy link
Member

I think more has to be done to make us pytest-compatible, lots of the tests are getting skipped that shouldn't be.

Note that the setup.py entrypoint does some extra work here.

I believe the equivalent of the setup and teardown functions will need to be done in a conftest.py fixture:

def pymongo_test_fixture(scope='session', autouse=True):
      # do setup stuff
      yield
      # do teardown stuff

@NoahStapp
Copy link
Contributor Author

Latest commit should address this, I've added a session-level autouse fixture to perform the setup and teardown found in the test module __init__.

I think more has to be done to make us pytest-compatible, lots of the tests are getting skipped that shouldn't be.

Note that the setup.py entrypoint does some extra work here.

I believe the equivalent of the setup and teardown functions will need to be done in a conftest.py fixture:

def pymongo_test_fixture(scope='session', autouse=True):
      # do setup stuff
      yield
      # do teardown stuff

Latest commit should address this, I've added a session-level autouse fixture to perform the setup and teardown found in the test module __init__.

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Very nice!

tox.ini Outdated
deps =
{[testenv:test]deps}
pymongocrypt>=1.6.0,<2.0.0
pymongo-auth-aws<2.0.0
Copy link
Member

Choose a reason for hiding this comment

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

is it possible to refer to extras here so we don't need to duplicate the dependencies? like .[encryption]?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah that should work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks!

@NoahStapp NoahStapp requested a review from ShaneHarvey June 21, 2023 21:36
Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

Nice LGTM!

@NoahStapp NoahStapp merged commit b16e06a into mongodb:master Jun 21, 2023
NoahStapp added a commit to NoahStapp/mongo-python-driver that referenced this pull request Jun 21, 2023
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.

3 participants