Skip to content

PYTHON-2262 Test Python 3.9 in Evergreen #485

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 1 commit into from
Sep 14, 2020

Conversation

ShaneHarvey
Copy link
Member

This change adds testing for Python 3.9 and fixes:

[2020/09/10 20:55:18.185] FAIL [0.002s]: test_instantiation (test_custom_types.TestBSONTypeEnDeCodecs)
[2020/09/10 20:55:18.185] ----------------------------------------------------------------------
[2020/09/10 20:55:18.185] TypeError: Can't instantiate abstract class testcodec with abstract method transform_python
[2020/09/10 20:55:18.185] During handling of the above exception, another exception occurred:
[2020/09/10 20:55:18.185] Traceback (most recent call last):
[2020/09/10 20:55:18.185]   File "/data/mci/183724bc86e179ad6d136f6b74916c26/src/test/test_custom_types.py", line 270, in test_instantiation
[2020/09/10 20:55:18.185]     run_test(TypeEncoder, {'python_type': MyType,}, fail=True)
[2020/09/10 20:55:18.185]   File "/data/mci/183724bc86e179ad6d136f6b74916c26/src/test/test_custom_types.py", line 263, in run_test
[2020/09/10 20:55:18.185]     codec()
[2020/09/10 20:55:18.185] AssertionError: "Can't instantiate abstract class .* with abstract methods .*" does not match "Can't instantiate abstract class testcodec with abstract method transform_python"

I've opened https://jira.mongodb.org/browse/PYTHON-2365 and https://jira.mongodb.org/browse/PYTHON-2366 as follow up work to test snappy, FLE, and OCSP. You'll notice this is also based on #484 to get the tests green.

@@ -255,7 +255,7 @@ def fallback_encoder(value):

class TestBSONTypeEnDeCodecs(unittest.TestCase):
def test_instantiation(self):
msg = "Can't instantiate abstract class .* with abstract methods .*"
msg = "Can't instantiate abstract class"
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of outright removing the latter half of this regex, might it be acceptable to use the following instead?
Can't instantiate abstract class .* with abstract method.* .*

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't Can't instantiate abstract class enough to ensure the TypeError is from instantiation?

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Highlights include:

- Support for Python 3.9.
- New method :class:`bson.json_util.JSONOptions.with_options`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding this!

@@ -255,7 +255,7 @@ def fallback_encoder(value):

class TestBSONTypeEnDeCodecs(unittest.TestCase):
def test_instantiation(self):
msg = "Can't instantiate abstract class .* with abstract methods .*"
msg = "Can't instantiate abstract class"
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@ShaneHarvey
Copy link
Member Author

Rebased to remove the "PYTHON-2362 Use dnspython<2.0 to avoid timeouts" commit which was already merged.

@ShaneHarvey ShaneHarvey merged commit 1b97edd into mongodb:master Sep 14, 2020
@ShaneHarvey ShaneHarvey deleted the PYTHON-2262 branch September 14, 2020 18:56
chrisburr added a commit to chrisburr/pymongo-feedstock that referenced this pull request Oct 10, 2020
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