Bug #89318
test_fields.py::test_page en erreur
0%
Description
Visiblement il manque la fixture pub
au test, il part en erreur quand il est le premier de son module à être lancé.
Révisions associées
Historique
Mis à jour par Robot Gitea il y a 21 jours
- Statut changé de Nouveau à En cours
- Assigné à mis à Yann Weber
Yann Weber (yweber) a ouvert une pull request sur Gitea concernant cette demande :
- URL : https://git.entrouvert.org/entrouvert/wcs/pulls/1386
- Titre : WIP: tests: add missing fixture to test_fields.test_page (#89318)
- Modifications : https://git.entrouvert.org/entrouvert/wcs/pulls/1386/files
Mis à jour par Robot Gitea il y a 21 jours
Frédéric Péters (fpeters) a relu et demandé des modifications sur une pull request sur Gitea concernant cette demande :
Mis à jour par Frédéric Péters il y a 21 jours
il part en erreur
C'est intéressant de la noter dans le ticket.
Mis à jour par Yann Weber il y a 21 jours
- Assigné à changé de Yann Weber à Benjamin Dauvergne
Frédéric Péters a écrit :
C'est intéressant de la noter dans le ticket.
En effet !
FAILED tests/test_fields.py::test_page - AttributeError: 'NoneType' object has no attribute 'error_context'
def test_page(): formdef = FormDef() formdef.fields = [] page = fields.PageField() > assert page.is_visible({}, formdef) is True tests/test_fields.py:331: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wcs/fields/base.py:614: in is_visible return self.evaluate_condition( wcs/fields/base.py:608: in evaluate_condition return PageCondition(condition, {'dict_vars': dict_vars, 'formdef': formdef}, record_errors).evaluate( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <PageCondition (None) None>, source_label = 'Field: ', source_url = '' def evaluate(self, source_label=None, source_url=None): > with get_publisher().error_context( condition=self.value, condition_type=self.type, source_label=source_label, source_url=source_url ): E AttributeError: 'NoneType' object has no attribute 'error_context' wcs/conditions.py:53: AttributeError
Mis à jour par Yann Weber il y a 21 jours
Robot Gitea a écrit :
Frédéric Péters (fpeters) a relu et demandé des modifications sur une pull request sur Gitea concernant cette demande :
Suite à ton commentaire j'ai lancé tox -e py3-django32-codestyle-coverage -- tests/test_fields.py -n 38
: il y a 38 tests, j'imagine que du coup il attribuera 1 test par worker et que de cette manière je peux détecter les tests à qui il manquerait la/une fixture ?
FAILED tests/test_fields.py::test_date - AttributeError: 'NoneType' object has no attribute 'current_language' FAILED tests/test_fields.py::test_page - AttributeError: 'NoneType' object has no attribute 'error_context' FAILED tests/test_fields.py::test_file_convert_from_anything - AttributeError: 'NoneType' object has no attribute 'app_dir' FAILED tests/test_fields.py::test_item_render - AttributeError: '_thread._local' object has no attribute 'publisher' FAILED tests/test_fields.py::test_item_render_as_autocomplete - AttributeError: '_thread._local' object has no attribute 'publisher' FAILED tests/test_fields.py::test_item_radio_lengths - AttributeError: '_thread._local' object has no attribute 'publisher' FAILED tests/test_fields.py::test_add_to_form - AttributeError: '_thread._local' object has no attribute 'publisher' FAILED tests/test_fields.py::test_items_render - AttributeError: '_thread._local' object has no attribute 'publisher' FAILED tests/test_fields.py::test_item_render_as_radio - AttributeError: '_thread._local' object has no attribute 'publisher' FAILED tests/test_fields.py::test_bool_stats - AttributeError: 'NoneType' object has no attribute 'cfg' 10 failed, 28 passed, 122 warnings in 7.11s
Mis à jour par Robot Gitea il y a 21 jours
- Statut changé de Solution proposée à Solution validée
Frédéric Péters (fpeters) a approuvé une pull request sur Gitea concernant cette demande :
Mis à jour par Frédéric Péters il y a 21 jours
- Assigné à changé de Benjamin Dauvergne à Yann Weber
Mis à jour par Robot Gitea il y a 18 jours
- Statut changé de Solution validée à Résolu (à déployer)
Frédéric Péters (fpeters) a mergé une pull request sur Gitea concernant cette demande :
- URL : https://git.entrouvert.org/entrouvert/wcs/pulls/1386
- Titre : tests: add missing fixture to test_fields.test_page (#89318)
- Modifications : https://git.entrouvert.org/entrouvert/wcs/pulls/1386/files
Mis à jour par Transition automatique il y a 18 jours
- Statut changé de Résolu (à déployer) à Solution déployée
tests: add missing fixture to test_fields tests (#89318)