-
Notifications
You must be signed in to change notification settings - Fork 329
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
remove the python 3.7 #566
remove the python 3.7 #566
Conversation
Thanks for your PR. It's still missing a few things, though. See #565 for a list it things that need to be done. |
check it out is it correct. |
The $ ag asynctest tests/ -B5
tests/v201/conftest.py
1-try:
2- from unittest.mock import AsyncMock
3-except ImportError:
4- # Python 3.7 and below don't include unittest.mock.AsyncMock. Hence,
5- # we need to resolve to a package on pypi.
6: from asynctest import CoroutineMock as AsyncMock
tests/v16/conftest.py
1-try:
2- from unittest.mock import AsyncMock
3-except ImportError:
4- # Python 3.7 and below don't include unittest.mock.AsyncMock. Hence,
5- # we need to resolve to a package on pypi.
6: from asynctest import CoroutineMock as AsyncMock
tests/conftest.py
1-try:
2- from unittest.mock import AsyncMock
3-except ImportError:
4- # Python 3.7 and below don't include unittest.mock.AsyncMock. Hence,
5- # we need to resolve to a package on pypi.
6: from asynctest import CoroutineMock as AsyncMock
tests/v20/conftest.py
1-try:
2- from unittest.mock import AsyncMock
3-except ImportError:
4- # Python 3.7 and below don't include unittest.mock.AsyncMock. Hence,
5- # we need to resolve to a package on pypi.
6: from asynctest import CoroutineMock as AsyncMock Those references must be removed. Also, the |
See is it correct |
I have completely remove all the python 3.7 version from the required files aslo asynctest |
if sys.version_info < (3, 8): | ||
from asynctest import CoroutineMock as AsyncMock | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this PR aim to drop support for Python 3.7. Therefore, this code is not needed.
Even if you run the code with Python 3.7, it would fails. Since the dependency asynctest
has been removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to remove import sys
, since that module isn't used anymore.
tests/v16/conftest.py
Outdated
try: | ||
from unittest.mock import AsyncMock | ||
except ImportError: | ||
# Python 3.7 and below don't include unittest.mock.AsyncMock. Hence, | ||
# we need to resolve to a package on pypi. | ||
from asynctest import CoroutineMock as AsyncMock | ||
|
||
if sys.version_info < (3, 8): | ||
from asynctest import CoroutineMock as AsyncMock | ||
else: | ||
AsyncMock = None # Set to None for Python 3.8 and above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove these lines in favor of :
from unittest.mock import AsyncMock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check it out its now correct?
# we need to resolve to a package on pypi. | ||
from asynctest import CoroutineMock as AsyncMock | ||
|
||
import sys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sys
is not used. Please remove it.
if sys.version_info < (3, 8): | ||
from asynctest import CoroutineMock as AsyncMock | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to remove import sys
, since that module isn't used anymore.
No its not ready yet, please read my all my comments. |
Co-authored-by: Auke Willem Oosterhoff <[email protected]>
Sorry, this issue became important to resolve, so I have opened a PR to replace it in this OCPP library - #585 - therefore, I will close this. |
No description provided.