Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature Request: Unloading function unload_dotenv()

Aperta
#594 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start by locating the existing load_dotenv() and dotenv_values() entry points and their tests. Check how dotenv-loaded variables are identified and verify that the proposed unload_dotenv() behavior is covered, including removing variables without affecting unrelated environment variables.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Once load_dotenv() has run, variables are set. To remove them again for unit testing, I need a function, because tests should be independent. I coded this function already, but I think it would be nice to have it included in dotenv. I guess, I'm not the only one with the described problem. But maybe I'm wrong. I stepped over this more than once now. That's why I'm suggesting adding this function:

def unload_dotenv():
    """Remove all dotenv variables from environment."""

    dotenv_vars = set(dotenv_values().keys())
    for key in dotenv_vars:
        os.environ.pop(key, None)
Lingua principale
Python
Stelle
8.9k
Fork
581
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di theskumar/python-dotenv

Tutte le issue di theskumar/python-dotenv

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.