question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🐞 Python 3.9.7 causes tests to fail

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Python 3.9.7 was found by the CI to cause issues with the existing test suite.

Expected Behavior

Tests should run as 3.9.5 and successfully pass.

Steps To Reproduce

  1. Set environment to 3.9.7 This can be done with poetry env use 3.9.7 and pyenv local 3.9.7

  2. Run make tests

Environment

- OS: Mac, Windows, Linux

Anything else?

This workflow shows the bugs if you wish to see the problems before starting https://github.com/microsoft/electionguard-python/runs/3655735644?check_suite_focus=true

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
keithrfungcommented, Oct 6, 2021

@ronnie-llamado If you can work on this that would be amazing, but regardless, thank you so much for the clarification.

0reactions
ronnie-llamadocommented, Oct 8, 2021

@keithrfung I realized this right as #458 was merged. Pulling over last comment from PR:

I believe AnnotatedString doesn’t throw because of the ordering of the elements. AnnotatedString has only optional parameters where all the others have both.

I had the same thought at one point, but ContactInformation also only has optional parameters.

It actually looks like AnnotatedString is not being instantiated in the testing, so no errors are being thrown. When generating ContactInformation, emails are passed in straight from hypothesis and no phone numbers are passed in. These two are expected to be of type AnnotatedString.

https://github.com/microsoft/electionguard-python/blob/f3e2f09503cab2214706240404ca70d5f7a925b0/src/electionguard_tools/strategies/election.py#L178-L185

Explicitly defining __init__ for AnnotatedString will complete the workaround for Python 3.9.7. In addition, emails() can be cast as an AnnotatedString to ensure testing coverage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue 41405: python 3.9.0b5 test - Issue Tracker
Date User Action 2022‑04‑11 14:59:34 admin set 2020‑07‑28 21:15:27 ned.deily set 2020‑07‑28 06:03:18 Jim.Jewett set
Read more >
Linking to system python lib fails… | Apple Developer Forums
Code that compiled fine with XCode 12 / Big Sur fails on XCode 13/Monterey with the linker error: "cannot link directly with dylib/framework,...
Read more >
Get Started — pytest documentation
pytest discovers all tests following its Conventions for Python test ... values in the assertion to help you understand the reason for the...
Read more >
in VS Code ImportError: cannot import name 'Mapping' from ...
As stated by others, this is caused by a change in the collections interface starting with Python 3.10. As far as I can...
Read more >
M220P: can't manually run projections test - MongoDB
(well, the requests module, obviously) I've got python 3.9.7 running on Ubuntu. thanks, Phil. steevej (Steeve Juneau) May 8, 2022, 1:21pm #2.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found