-
Notifications
You must be signed in to change notification settings - Fork 103
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 Python 2 compatibility code #142
Comments
One of these is already done: remove Regarding the changes which affect the snapshots, I just wanted to think through for a minute:
|
[Updated the
Perhaps we should move updating the snapshot header into #143 or a new issue, and make this issue only about the source and test code? |
That sounds like a great idea. I could be wrong, though I’m thinking the header changes may not be a good first issue either. |
I will also recommend drop Python 3.5 support since dealing with some (now) strange limitations - like no support for path-like objects - is a bit frustrating ;) |
@medmunds The use of File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
exec(co, module.__dict__)
File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/snapshottest/__init__.py", line 3, in <module>
from .module import assert_match_snapshot
File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
exec(co, module.__dict__)
File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/snapshottest/module.py", line 4, in <module>
import imp
ModuleNotFoundError: No module named 'imp' |
@Kilo59 of course. I wasn't arguing to keep [Incidentally, I haven't been actively involved in this project for a few years now.] |
Good first issue for anyone looking to contribute. Support for Python <3.5 was dropped after the 0.6.0 release, so there are some leftover Python 2-isms that can be removed from the code:
object
as a superclass—change allclass ClassName(object):
to justclass ClassName:
super(ClassName, self).method(...)
calls to justsuper().method(...)
# -*- coding: utf-8 -*-
markers (source and generated snapshot headers)from __future__
imports (source andgenerated snapshot headers)[Note: you might be tempted to also update string formatting to use f-strings, but those aren't available until Python 3.6, so we'll need to hold off for now.]
The text was updated successfully, but these errors were encountered: