gweis / isodate

ISO 8601 date/time parser
BSD 3-Clause "New" or "Revised" License
148 stars 58 forks source link

0.6.0: pytest warnings #67

Closed kloczek closed 2 years ago

kloczek commented 3 years ago
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-isodate-0.6.0-8.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-isodate-0.6.0-8.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/python3 -Bm pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/isodate-0.6.0
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, asyncio-0.14.0, expect-1.1.0, cov-2.11.1, mock-3.5.1, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, pyfakefs-4.4.0, freezegun-0.4.2, flaky-3.7.0, cases-3.4.6, hypothesis-6.10.0
collected 18 items

src/isodate/tests/test_date.py .                                                                                                                                     [  5%]
src/isodate/tests/test_datetime.py .                                                                                                                                 [ 11%]
src/isodate/tests/test_duration.py ..........                                                                                                                        [ 66%]
src/isodate/tests/test_pickle.py ....                                                                                                                                [ 88%]
src/isodate/tests/test_strf.py .                                                                                                                                     [ 94%]
src/isodate/tests/test_time.py .                                                                                                                                     [100%]

============================================================================= warnings summary =============================================================================
src/isodate/tests/test_duration.py: 18 warnings
  /home/tkloczko/rpmbuild/BUILD/isodate-0.6.0/src/isodate/duration.py:183: DeprecationWarning: an integer is required (got type decimal.Decimal).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
    newdt = other.replace(year=newyear, month=newmonth, day=newday)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
===================================================================== 18 passed, 18 warnings in 0.12s ======================================================================
hugovk commented 3 years ago

Please see https://github.com/gweis/isodate/pull/68 for a fix. Note this becomes an error in Python 3.10, due out in three weeks.

hugovk commented 3 years ago

This issue is a duplicate of https://github.com/gweis/isodate/issues/58.

hugovk commented 2 years ago

Fixed in the fork at https://github.com/isodate/isodate/pull/1.

kloczek commented 2 years ago

So https://github.com/isodate/isodate is fork or main line?

hugovk commented 2 years ago

https://github.com/isodate/isodate is a fork.

kloczek commented 2 years ago

Tested 0.6.1 and all lokks clean :)

Thank you.

=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=146938904
rootdir: /data/home/tkloczko/rpmbuild/BUILD/isodate-0.6.1
plugins: shutil-1.7.0, virtualenv-1.7.0, mock-3.6.1, cov-2.12.1, anyio-3.3.4, flaky-3.7.0, tornasync-0.6.0.post2, console-scripts-1.2.0, trio-0.7.0, timeout-2.0.1, asyncio-0.16.0, freezegun-0.4.2, flake8-1.0.7, pyfakefs-4.5.3, benchmark-3.4.1, profiling-1.7.0, datadir-1.3.1, regressions-2.2.0, randomly-3.8.0, rerunfailures-9.1.1, yagot-0.5.0, requests-mock-1.9.3, subtests-0.5.0, easy-server-0.8.0, django-4.5.2, forked-1.4.0, ordering-0.6, xdist-2.5.0, hypothesis-6.31.4
collected 18 items

src/isodate/tests/test_date.py .                                                                                                                                     [  5%]
src/isodate/tests/test_datetime.py .                                                                                                                                 [ 11%]
src/isodate/tests/test_pickle.py ....                                                                                                                                [ 33%]
src/isodate/tests/test_strf.py .                                                                                                                                     [ 38%]
src/isodate/tests/test_time.py .                                                                                                                                     [ 44%]
src/isodate/tests/test_duration.py ..........                                                                                                                        [100%]

============================================================================ 18 passed in 0.49s ============================================================================