python 3.8: `test_date*_behaves_like_date*` tests fail with AttributeError
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 55/100
Direzione di ricerca
Inizia dai test che falliscono in tests/test_items.py, quindi esamina le implementazioni di DateTime e Date in tomlkit/items.py nelle vicinanze delle righe segnalate. Riproduci i fallimenti su Python 3.8 e verifica che i test del comportamento di date e datetime passino, preservando i confronti mostrati e l'output stringa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
=================================== FAILURES ===================================
_____________________ test_datetimes_behave_like_datetimes _____________________
def test_datetimes_behave_like_datetimes():
i = item(datetime(2018, 7, 22, 12, 34, 56))
assert i == datetime(2018, 7, 22, 12, 34, 56)
assert i.as_string() == "2018-07-22T12:34:56"
> i += timedelta(days=1)
tests/test_items.py:275:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tomlkit/items.py:525: in __add__
result = super(DateTime, self).__add__(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'tomlkit.items.DateTime'>, value = 2018
_ = (7, 23, 12, 34, 56, 0, ...)
def __new__(cls, value, *_): # type: (..., datetime, ...) -> datetime
return datetime.__new__(
cls,
> value.year,
value.month,
value.day,
value.hour,
value.minute,
value.second,
value.microsecond,
tzinfo=value.tzinfo,
)
E AttributeError: 'int' object has no attribute 'year'
tomlkit/items.py:498: AttributeError
_________________________ test_dates_behave_like_dates _________________________
def test_dates_behave_like_dates():
i = item(date(2018, 7, 22))
assert i == date(2018, 7, 22)
assert i.as_string() == "2018-07-22"
> i += timedelta(days=1)
tests/test_items.py:295:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tomlkit/items.py:584: in __add__
result = super(Date, self).__add__(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'tomlkit.items.Date'>, value = 2018, _ = (7, 23)
def __new__(cls, value, *_): # type: (..., date, ...) -> date
> return date.__new__(cls, value.year, value.month, value.day)
E AttributeError: 'int' object has no attribute 'year'
tomlkit/items.py:565: AttributeError
- Lingua principale
- Python
- Stelle
- 850
- Fork
- 163
- Merge medio
- 13m
- PR unite (30g)
- 2
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-poetry/tomlkit
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
python-poetry/tomlkit#546 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
python-poetry/tomlkit#603 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
python-poetry/tomlkit#580 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
python-poetry/tomlkit#577 ·
-
Looking for a co-maintainer Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
python-poetry/tomlkit#574 · 5 commenti ·
Tutte le issue di python-poetry/tomlkit
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·