Closed QuLogic closed 7 months ago
Update:
This was retained in Python 3.11 (released October 2022), but has already been removed in Python 3.12 (set for release October 2023):
Nevertheless, I recommend merging this fix. The old Python versions (3.6+) will still work with this fix.
$ python3.11 -m coverage run --source=gpxpy ./test.py
...
----------------------------------------------------------------------
Ran 137 tests in 2.115s
OK (skipped=1)
$ python3.12 -m coverage run --source=gpxpy ./test.py
...
======================================================================
ERROR: test_microsecond (__main__.GPXTests.test_microsecond)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/private/tmp/gpxpy/test.py", line 3448, in test_microsecond
self.assertEquals(207343, gpx2.tracks[0].segments[0].points[0].time.microsecond) # type: ignore
^^^^^^^^^^^^^^^^^
AttributeError: 'GPXTests' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?
----------------------------------------------------------------------
Ran 137 tests in 1.373s
FAILED (errors=1, skipped=1)
@tkrajina Could this be included? Without this patch, the test-suite fails with Python 3.12, which is starting to roll out in distro's.
This function was deprecated in 3.2, so the substitution will work on all Python versions you support.
assertEquals
was replaced byassertEqual
, and the former has been deleted from Python 3.11.