Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mikemanger
Copy link
Contributor

@mikemanger mikemanger commented Dec 5, 2024

Some fixes to the tests

  • Fix the tox config (previously the fixtures weren't getting included so it would fail)
  • Use assetEqual instead of assertEquals
  • Remove unsupported nosetests file
  • adds a GitHub workflow

Copy link
Contributor

@russella-acm russella-acm left a comment

Choose a reason for hiding this comment

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

Hi @mikemanger - thank you enormously for the excellent changes here in this pull request - we really appreciate your work here. I am eager to get this PR moving ahead.

I had a few things which I wanted to go over with you to get us to that stage. With all this, please keep in mind I am not an experienced Python developer and so there might be some things I am off the mark about and I'm happy to learn and be corrected along the way.

These were the items I had in mind:

  • Earlier today, I merged in your work from #84 which have some changes in common with this PR - namely changing assertEquals to assertEqual. This is now in master and in the latest version of the package (8.0.2) and hopefully bringing those changes across in to this PR will reduce the number of changes.
  • I am not too familiar with the github workflow side of things but I am happy to go ahead with those changes for the automated testing side of things.
  • I ran tox and that was showing some issues with version Python 3.7, namely this issue shown below. Python version 3.6 is skipped and 3.7 doesn't run properly:
    image

The error for Python 7 I was seeing on my machine was this:
image

How would we feel about removing Python versions 3.6 and 3.7 from tests.yml and tox.ini? I have left these as things to consider below. I'm happy to update the documentation saying that we do not support those two versions any more. Having said that, I did test with Python 3.6 and the wrapper appears to still be working as before.

  • From Python version 3.11 and onwards, I noticed this deprecation warning that came up:
\createsend-python\lib\createsend\utils.py:106: DeprecationWarning: ssl.SSLContext() without protocol argument is deprecated.
    context = ssl.SSLContext()

\createsend-python\lib\createsend\utils.py:106: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
    context = ssl.SSLContext()

I attempted to remove this warning by changing utils.py line 106:

From:
ssl.SSLContext()

To:
ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)

But that resulted in this failure:
image

FAILED test/test_verifiedhttpsconnection.py::VerifiedHTTPSConnectionTestCase::test_verified_connection - ValueError: check_hostname requires server_hostname

For now, I was thinking we're happy to leave it as a warning and figure out a fix for that separately.

So with all that in mind after:

  • this PR has the latest from master merged in; and
  • if you agree that removing 3.6 and 3.7 is a good idea and we do so

I'm happy to get this approved, merged and released ASAP. Thank you once again for your help and pushing for this code base to be modernised.

@mikemanger
Copy link
Contributor Author

Hey @russella-acm thanks for the great review!

Interestingly the python 3.7 tests runs fine on my GH workflow (you can see this here) so I'm wondering if it is an issue with pip on Windows (a quick search didn't return anything).

Either way I'm happy to drop support for Python 3.7 (its EOL over a year now). I've updated this branch and also fixed a couple of small typos.

With the 3.11 deprecation warning I think we should tackle that in another PR as important but outside the scope of this PR.

Copy link
Contributor

@russella-acm russella-acm left a comment

Choose a reason for hiding this comment

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

LGTM - Thank you @mikemanger - really appreciate the changes, I will go about getting these in and releasing them in a next version ASAP.

I tested out tox, unit tests and ran then the wrapper code. All working as expected.

@russella-acm russella-acm merged commit f74dfff into campaignmonitor:master Dec 7, 2024
1 check passed
@mikemanger mikemanger deleted the update-tests branch December 9, 2024 21:50
AlexisT-CM pushed a commit that referenced this pull request Jan 23, 2025
AlexisT-CM pushed a commit that referenced this pull request Jan 23, 2025
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