python / python/cpython

unittest discovery and test.regrtest cannot find tests when they're not on the filesystem

Ouverte
#157,144 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

stdlib tests type-feature
Langage dominant
Python
Étoiles
77.2k
Forks
35.9k
Métriques de merge des PR
Métriques de PR en attente

Description

Bug report

Bug description:

When the standard library is a zip archive on sys.path, the test package is not a directory: findtests() failed with an OSError from os.listdir() and load_package_tests() failed with "Start directory is not importable" from unittest discovery.

I'm still deciding if this should be done, it is perhaps odd thing to do to bundle tests into an archive before running, but this should apply to other import hooks as well and bundling tests into a zip is sort of a nice way of running tests against a fully zipped application. It's a feature regardless.

Linked PRs
  • gh-157145

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par examiner unittest discovery et test.regrtest, puis reproduisez l’échec avec la bibliothèque standard dans une archive ZIP sur sys.path. Le travail est considéré comme terminé lorsque test discovery et regrtest peuvent localiser et exécuter des tests via des hooks d’importation ne passant pas par le système de fichiers ; gh-157145 est le PR lié à examiner en premier.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
testing-qa
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.