Using secrets in python test with tox

Hello everyone,

I am trying to use github actions and secrets in my python tests which I run via tox in repo https://github.com/romanjergon/flight_deals_searcher. Unfortunately I am not able to get the github secret value to python script even though it seems everything works in my other repo (without use of tox).

I have defined .yml file in .github/workflows/tests.yml

name: Tests

on:
  - push
  - pull_request

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
        python-version: ['3.9', '3.10']

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install tox tox-gh-actions
    - name: Test with tox
      run: tox
      env:
        KIWI_API_KEY: ${{ secrets.KIWI_API_KEY }}

Secret is defined for the repo:

I have defined no environments in github.

Env value is used in python test script
tests/test_flight_search.py

import pytest
import os
from flight_deals_searcher.flight_search import FlightSearch
from dotenv import load_dotenv


load_dotenv()

def test_flight_search():
    flight_searcher = FlightSearch(
        departure_code="PRG",
        kiwi_api_key=os.environ["KIWI_API_KEY"],
        kiwi_endpoint="http://tequila-api.kiwi.com",
        search_period_start=1,
        search_period_end=180,
    )

My job fails stating that the env variable does not exist - testing github secrets · romanjergon/flight_deals_searcher@29371c4 · GitHub

Not sure if it plays any role but my tox configuration is in tox.ini

Would anyone spot what is the cause of the issue?
Thank you!

As this post was originally hidden by I assume spam protection I have found solution.
My tox.ini lacked definition of which env variables should be passed to the tests, tox does not pass all the variables.
So I have extended [testenv] definition with

passenv =
    KIWI_API_KEY

which solved the issue.