aio-libs / aio-libs/yarl

tests/test_pydantic.py fails to collect

Aberta Para iniciantes
#1,872 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
1.5k
Forks
215
Merge médio
1d 2min
PRs com merge (30d)
13

Descrição

### Please confirm the following

- [ ] I agree to follow the [aio-libs Code of Conduct][CoC]

[CoC]: ../../.github/blob/master/CODE_OF_CONDUCT.md

- [X] I have checked the [current issues][issue search] for duplicates.

[issue search]: ../search?q=is%3Aissue&type=issues

- [X] I understand this is open source software provided for free and that I might not receive a timely response.
- [X] I am positive I am **NOT** reporting a (potential) security vulnerability, to the best of my knowledge. *(These must be shared by submitting [this report form][vulnerability report form] instead, if any hesitation exists.)*

[vulnerability report form]: ../security/advisories/new

- [ ] I am willing to submit a pull request with reporoducers as xfailing test cases or even entire fix. *(Assign this issue to me.)*

### Describe the bug

Not sure when it broke, but currently on FreeBSD, for either yarl 1.24.2 and 1.24.5, `tests/test_pydantic.py` fails to collect:

```
============================= test session starts ==============================
platform freebsd15 -- Python 3.12.14, pytest-9.1.1, pluggy-1.6.0 -- /usr/local/bin/python3.12
codspeed: 5.0.3 (disabled, mode: walltime, callgraph: not supported, timer_resolution: 280.0ns)
cachedir: .pytest_cache
hypothesis profile 'default'
rootdir: /work/usr/ports/www/py-yarl/work-py312/yarl-1.24.5
configfile: pytest.ini
testpaths: tests/
plugins: codspeed-5.0.3, hypothesis-6.165.10
collecting ... collected 1621 items / 1 error

==================================== ERRORS ====================================
___________________ ERROR collecting tests/test_pydantic.py ____________________
tests/test_pydantic.py:13: in
class TstModel(pydantic.BaseModel):
/usr/local/lib/python3.12/site-packages/pydantic/main.py:197: in __new__
fields[ann_name] = ModelField.infer(
/usr/local/lib/python3.12/site-packages/pydantic/fields.py:504: in infer
return cls(
/usr/local/lib/python3.12/site-packages/pydantic/fields.py:434: in __init__
self.prepare()
/usr/local/lib/python3.12/site-packages/pydantic/fields.py:555: in prepare
self.populate_validators()
/usr/local/lib/python3.12/site-packages/pydantic/fields.py:829: in populate_validators
*(get_validators() if get_validators else list(find_validators(self.type_, self.model_config))),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/local/lib/python3.12/site-packages/pydantic/validators.py:768: in find_validators
raise RuntimeError(f'no validator found for {type_}, see `arbitrary_types_allowed` in Config')
E RuntimeError: no validator found for , see `arbitrary_types_allowed` in Config
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 1.38s ===============================
```

Pydanyic version is 1.10.20. Full build log (including all versions of dependencies) here: https://gist.github.com/AMDmi3/6eac3b8045f644ed96890aaa36281bbb

### To Reproduce

Run pytest

### Expected behavior

Test should pass

### Python Version

```console
3.12.14
```

### multidict Version

```console
6.7.1
```

### propcache Version

```console
0.4.1
```

### yarl Version

```console
1.24.5
```

### OS

FreeBSD 15.1

### Additional context

_No response_

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Start by running pytest on tests/test_pydantic.py with Python 3.12, yarl 1.24.5, and Pydantic 1.10.20 to reproduce the collection error. Inspect the TstModel definition and its interaction with Pydantic, then run the test file and the full suite to confirm collection succeeds and the tests pass.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
testing
Tipo de issue
Bug
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Ativa
Clareza
Razoavelmente clara
Facilidade para iniciantes
70/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.