Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 863891 Details for
Bug 908560
dev-python/pytest-env-0.8.1: test suite is extremely fragile
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
dev-python:pytest-env-0.8.1:20230616-031107.log
dev-python:pytest-env-0.8.1:20230616-031107.log (text/plain), 246.83 KB, created by
Michał Górny
on 2023-06-16 03:33:38 UTC
(
hide
)
Description:
dev-python:pytest-env-0.8.1:20230616-031107.log
Filename:
MIME Type:
Creator:
Michał Górny
Created:
2023-06-16 03:33:38 UTC
Size:
246.83 KB
patch
obsolete
>[32m * [39;49;00mPackage: dev-python/pytest-env-0.8.1:0 >[32m * [39;49;00mRepository: gentoo >[32m * [39;49;00mMaintainer: marecki@gentoo.org python@gentoo.org >[32m * [39;49;00mUSE: abi_x86_64 amd64 elibc_glibc kernel_linux python_targets_python3_10 python_targets_python3_11 test >[32m * [39;49;00mFEATURES: ccache network-sandbox preserve-libs sandbox test userpriv usersandbox >>>> Unpacking source... >>>> Unpacking pytest_env-0.8.1.tar.gz to /tmp/portage/dev-python/pytest-env-0.8.1/work >>>> Source unpacked in /tmp/portage/dev-python/pytest-env-0.8.1/work >>>> Preparing source in /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1 ... > [32m*[0m Build system packages: > [32m*[0m dev-python/gpep517 : 13 > [32m*[0m dev-python/installer : 0.7.0 > [32m*[0m dev-python/hatchling : 1.18.0 > [32m*[0m dev-python/hatch-fancy-pypi-readme: 23.1.0 > [32m*[0m dev-python/hatch-vcs : 0.3.0 >>>> Source prepared. >>>> Configuring source in /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1 ... >>>> Source configured. >>>> Compiling source in /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1 ... > [32m*[0m python3_10: running distutils-r1_run_phase distutils-r1_python_compile > [32m*[0m Building the wheel for pytest_env-0.8.1 via hatchling.build >gpep517 build-wheel --backend hatchling.build --output-fd 3 --wheel-dir /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_10/wheel >2023-06-16 05:11:18,455 gpep517 INFO Building wheel via backend hatchling.build >2023-06-16 05:11:19,621 gpep517 INFO The backend produced /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_10/wheel/pytest_env-0.8.1-py3-none-any.whl > [32m*[0m Installing pytest_env-0.8.1-py3-none-any.whl to /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_10/install >gpep517 install-wheel --destdir=/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_10/install --interpreter=/usr/bin/python3.10 --prefix=/usr --optimize=all /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_10/wheel/pytest_env-0.8.1-py3-none-any.whl >2023-06-16 05:11:20,000 gpep517 INFO Installing /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_10/wheel/pytest_env-0.8.1-py3-none-any.whl into /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_10/install >2023-06-16 05:11:20,013 gpep517 INFO Installation complete > [32m*[0m python3_11: running distutils-r1_run_phase distutils-r1_python_compile > [32m*[0m Building the wheel for pytest_env-0.8.1 via hatchling.build >gpep517 build-wheel --backend hatchling.build --output-fd 3 --wheel-dir /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_11/wheel >2023-06-16 05:11:21,909 gpep517 INFO Building wheel via backend hatchling.build >2023-06-16 05:11:22,898 gpep517 INFO The backend produced /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_11/wheel/pytest_env-0.8.1-py3-none-any.whl > [32m*[0m Installing pytest_env-0.8.1-py3-none-any.whl to /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_11/install >gpep517 install-wheel --destdir=/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_11/install --interpreter=/usr/bin/python3.11 --prefix=/usr --optimize=all /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_11/wheel/pytest_env-0.8.1-py3-none-any.whl >2023-06-16 05:11:23,115 gpep517 INFO Installing /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_11/wheel/pytest_env-0.8.1-py3-none-any.whl into /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_11/install >2023-06-16 05:11:23,129 gpep517 INFO Installation complete >>>> Source compiled. >>>> Test phase: dev-python/pytest-env-0.8.1 > [32m*[0m python3_10: running distutils-r1_run_phase python_test >python3.10 -m pytest -vv -ra -l -Wdefault --color=yes -o console_output_style=count -p no:cov -p no:flake8 -p no:flakes -p no:pylint -p no:markdown -p no:sugar -p no:xvfb -p no:tavern >[1m========================================================= test session starts =========================================================[0m >platform linux -- Python 3.10.12, pytest-7.3.2, pluggy-1.0.0 -- /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1-python3_10/install/usr/bin/python3.10 >cachedir: .pytest_cache >metadata: {'Python': '3.10.12', 'Platform': 'Linux-6.3.7-gentoo-dist-x86_64-AMD_Ryzen_5_3600_6-Core_Processor-with-glibc2.37', 'Packages': {'pytest': '7.3.2', 'pluggy': '1.0.0'}, 'Plugins': {'env': '0.8.1', 'timeout': '2.1.0', 'tornado': '0.8.1', 'freezegun': '0.4.2', 'aiohttp': '1.0.4', 'expect': '1.1.0', 'shutil': '1.7.0', 'virtualenv': '1.7.0', 'lazy-fixture': '0.6.3', 'betamax': '0.8.1', 'services': '2.2.1', 'helpers-namespace': '2021.12.29', 'snapshottest': '0.6.0', 'codeblocks': '0.16.1', 'subtesthack': '0.2.0', 'kgb': '7.1.1', 'flaky': '3.7.0', 'django': '4.5.2', 'shell-utilities': '1.7.0', 'datadir': '1.4.1', 'trio': '0.8.0', 'ordering': '0.6', 'bdd': '6.1.1', 'pylama': '8.4.1', 'skip-markers': '1.4.0', 'plus': '0.4.0', 'jaraco.test': '5.3.0', 'time-machine': '2.9.0', 'regressions': '2.4.2', 'nbval': '0.10.0', 'localserver': '0.7.1', 'xdoctest': '1.1.1', 'forked': '1.6.0', 'xprocess': '0.22.2', 'pytest_param_files': '0.3.5', 'localftpserver': '1.1.4', 'rerunfailures': '11.1.2', 'asyncio': '0.21.0', 'describe': '2.1.0', 'pyfakefs': '5.2.2', 'httpx': '0.22.0', 'pkgcore': '0.12.21', 'httpbin': '2.0.0', 'typeguard': '4.0.0', 'subtests': '0.11.0', 'xdist': '3.3.1', 'testinfra': '8.1.0', 'httpserver': '1.0.8', 'metadata': '3.0.0', 'anyio': '3.7.0', 'libtmux': '0.22.1', 'Faker': '18.10.1', 'sphinx_pytest': '0.1.1', 'check': '2.1.5', 'console-scripts': '1.4.1', 'requests-mock': '1.11.0', 'hypothesis': '6.78.2', 'mock': '3.11.1'}, 'JAVA_HOME': '/etc/java-config-2/current-system-vm'} >hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/.hypothesis/examples') >rootdir: /tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1 >plugins: env-0.8.1, timeout-2.1.0, tornado-0.8.1, freezegun-0.4.2, aiohttp-1.0.4, expect-1.1.0, shutil-1.7.0, virtualenv-1.7.0, lazy-fixture-0.6.3, betamax-0.8.1, services-2.2.1, helpers-namespace-2021.12.29, snapshottest-0.6.0, codeblocks-0.16.1, subtesthack-0.2.0, kgb-7.1.1, flaky-3.7.0, django-4.5.2, shell-utilities-1.7.0, datadir-1.4.1, trio-0.8.0, ordering-0.6, bdd-6.1.1, pylama-8.4.1, skip-markers-1.4.0, plus-0.4.0, jaraco.test-5.3.0, time-machine-2.9.0, regressions-2.4.2, nbval-0.10.0, localserver-0.7.1, xdoctest-1.1.1, forked-1.6.0, xprocess-0.22.2, pytest_param_files-0.3.5, localftpserver-1.1.4, rerunfailures-11.1.2, asyncio-0.21.0, describe-2.1.0, pyfakefs-5.2.2, httpx-0.22.0, pkgcore-0.12.21, httpbin-2.0.0, typeguard-4.0.0, subtests-0.11.0, xdist-3.3.1, testinfra-8.1.0, httpserver-1.0.8, metadata-3.0.0, anyio-3.7.0, libtmux-0.22.1, Faker-18.10.1, sphinx_pytest-0.1.1, check-2.1.5, console-scripts-1.4.1, requests-mock-1.11.0, hypothesis-6.78.2, mock-3.11.1 >asyncio: mode=strict >[1mcollecting ... [0mcollected 14 items > >tests/test_env.py::test_env[new key - add to env] [31mFAILED[0m[31m [ 1/14][0m >tests/test_env.py::test_env[two new keys - add to env] [31mFAILED[0m[31m [ 2/14][0m >tests/test_env.py::test_env[D flag - add to env] [31mFAILED[0m[31m [ 3/14][0m >tests/test_env.py::test_env[key exists in env - overwrite] [31mFAILED[0m[31m [ 4/14][0m >tests/test_env.py::test_env[D exists - original val kept] [31mFAILED[0m[31m [ 5/14][0m >tests/test_env.py::test_env[curly exist - interpolate var] [31mFAILED[0m[31m [ 6/14][0m >tests/test_env.py::test_env[R exists - not interpolate var] [31mFAILED[0m[31m [ 7/14][0m >tests/test_env.py::test_env[incremental interpolation] [31mFAILED[0m[31m [ 8/14][0m >tests/test_env.py::test_env[two flags] [31mFAILED[0m[31m [ 9/14][0m >tests/test_env.py::test_env[two flags - reversed] [31mFAILED[0m[31m [10/14][0m >tests/test_env.py::test_env[lowercase flags] [31mFAILED[0m[31m [11/14][0m >tests/test_env.py::test_env[whitespace is ignored] [31mFAILED[0m[31m [12/14][0m >tests/test_env.py::test_env[empty ini works] [31mFAILED[0m[31m [13/14][0m >tests/test_version.py::test_version [32mPASSED[0m[31m [14/14][0m > >============================================================== FAILURES =============================================================== >[31m[1m___________________________________________________ test_env[new key - add to env] ____________________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env0')>, env = {} >ini = '[pytest]\nenv = MAGIC=alpha', expected_env = {'MAGIC': 'alpha'} >request = <FixtureRequest for <Function test_env[new key - add to env]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {} >expected_env = {'MAGIC': 'alpha'} >ini = '[pytest]\nenv = MAGIC=alpha' >request = <FixtureRequest for <Function test_env[new key - add to env]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=22 duration=1.00s> >test_name = 'new_key___add_to_env' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env0')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=22 duration=1.00s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >[31m[1m_________________________________________________ test_env[two new keys - add to env] _________________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env1')>, env = {} >ini = '[pytest]\nenv = MAGIC=alpha\n SORCERY=beta', expected_env = {'MAGIC': 'alpha', 'SORCERY': 'beta'} >request = <FixtureRequest for <Function test_env[two new keys - add to env]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {} >expected_env = {'MAGIC': 'alpha', 'SORCERY': 'beta'} >ini = '[pytest]\nenv = MAGIC=alpha\n SORCERY=beta' >request = <FixtureRequest for <Function test_env[two new keys - add to env]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.95s> >test_name = 'two_new_keys___add_to_env' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env1')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.95s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[31m[1m____________________________________________________ test_env[D flag - add to env] ____________________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env2')>, env = {} >ini = '[pytest]\nenv = d:MAGIC=beta', expected_env = {'MAGIC': 'beta'} >request = <FixtureRequest for <Function test_env[D flag - add to env]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {} >expected_env = {'MAGIC': 'beta'} >ini = '[pytest]\nenv = d:MAGIC=beta' >request = <FixtureRequest for <Function test_env[D flag - add to env]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=1.18s> >test_name = 'd_flag___add_to_env' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env2')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=1.18s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[31m[1m_______________________________________________ test_env[key exists in env - overwrite] _______________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env3')> >env = {'MAGIC': 'alpha'}, ini = '[pytest]\nenv = MAGIC=beta', expected_env = {'MAGIC': 'beta'} >request = <FixtureRequest for <Function test_env[key exists in env - overwrite]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {'MAGIC': 'alpha'} >expected_env = {'MAGIC': 'beta'} >ini = '[pytest]\nenv = MAGIC=beta' >request = <FixtureRequest for <Function test_env[key exists in env - overwrite]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.88s> >test_name = 'key_exists_in_env___overwrite' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env3')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.88s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[31m[1m_______________________________________________ test_env[D exists - original val kept] ________________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env4')> >env = {'MAGIC': 'alpha'}, ini = '[pytest]\nenv = D:MAGIC=beta', expected_env = {'MAGIC': 'alpha'} >request = <FixtureRequest for <Function test_env[D exists - original val kept]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {'MAGIC': 'alpha'} >expected_env = {'MAGIC': 'alpha'} >ini = '[pytest]\nenv = D:MAGIC=beta' >request = <FixtureRequest for <Function test_env[D exists - original val kept]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.83s> >test_name = 'd_exists___original_val_kept' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env4')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.83s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[31m[1m_______________________________________________ test_env[curly exist - interpolate var] _______________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env5')> >env = {'PLANET': 'world'}, ini = '[pytest]\nenv = MAGIC=hello_{PLANET}', expected_env = {'MAGIC': 'hello_world'} >request = <FixtureRequest for <Function test_env[curly exist - interpolate var]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {'PLANET': 'world'} >expected_env = {'MAGIC': 'hello_world'} >ini = '[pytest]\nenv = MAGIC=hello_{PLANET}' >request = <FixtureRequest for <Function test_env[curly exist - interpolate var]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=1.10s> >test_name = 'curly_exist___interpolate_var' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env5')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=1.10s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[31m[1m______________________________________________ test_env[R exists - not interpolate var] _______________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env6')> >env = {'PLANET': 'world'}, ini = '[pytest]\nenv = R:MAGIC=hello_{PLANET}', expected_env = {'MAGIC': 'hello_{PLANET}'} >request = <FixtureRequest for <Function test_env[R exists - not interpolate var]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {'PLANET': 'world'} >expected_env = {'MAGIC': 'hello_{PLANET}'} >ini = '[pytest]\nenv = R:MAGIC=hello_{PLANET}' >request = <FixtureRequest for <Function test_env[R exists - not interpolate var]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=1.05s> >test_name = 'r_exists___not_interpolate_var' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env6')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=1.05s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[31m[1m_________________________________________________ test_env[incremental interpolation] _________________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env7')>, env = {'MAGIC': 'a'} >ini = '[pytest]\nenv = R:MAGIC={MAGIC}b\n D:MAGIC={MAGIC}c\n MAGIC={MAGIC}d', expected_env = {'MAGIC': '{MAGIC}bd'} >request = <FixtureRequest for <Function test_env[incremental interpolation]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {'MAGIC': 'a'} >expected_env = {'MAGIC': '{MAGIC}bd'} >ini = '[pytest]\nenv = R:MAGIC={MAGIC}b\n D:MAGIC={MAGIC}c\n MAGIC={MAGIC}d' >request = <FixtureRequest for <Function test_env[incremental interpolation]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.84s> >test_name = 'incremental_interpolation' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env7')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.84s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[31m[1m_________________________________________________________ test_env[two flags] _________________________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env8')> >env = {'PLANET': 'world'}, ini = '[pytest]\nenv = D:R:RESULT=hello_{PLANET}', expected_env = {'RESULT': 'hello_{PLANET}'} >request = <FixtureRequest for <Function test_env[two flags]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {'PLANET': 'world'} >expected_env = {'RESULT': 'hello_{PLANET}'} >ini = '[pytest]\nenv = D:R:RESULT=hello_{PLANET}' >request = <FixtureRequest for <Function test_env[two flags]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.74s> >test_name = 'two_flags' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env8')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.74s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[31m[1m___________________________________________________ test_env[two flags - reversed] ____________________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env9')> >env = {'PLANET': 'world'}, ini = '[pytest]\nenv = R:D:RESULT=hello_{PLANET}', expected_env = {'RESULT': 'hello_{PLANET}'} >request = <FixtureRequest for <Function test_env[two flags - reversed]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {'PLANET': 'world'} >expected_env = {'RESULT': 'hello_{PLANET}'} >ini = '[pytest]\nenv = R:D:RESULT=hello_{PLANET}' >request = <FixtureRequest for <Function test_env[two flags - reversed]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.67s> >test_name = 'two_flags___reversed' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env9')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.67s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[31m[1m______________________________________________________ test_env[lowercase flags] ______________________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env10')> >env = {'PLANET': 'world'}, ini = '[pytest]\nenv = d:r:RESULT=hello_{PLANET}', expected_env = {'RESULT': 'hello_{PLANET}'} >request = <FixtureRequest for <Function test_env[lowercase flags]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {'PLANET': 'world'} >expected_env = {'RESULT': 'hello_{PLANET}'} >ini = '[pytest]\nenv = d:r:RESULT=hello_{PLANET}' >request = <FixtureRequest for <Function test_env[lowercase flags]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.63s> >test_name = 'lowercase_flags' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env10')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.63s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[31m[1m___________________________________________________ test_env[whitespace is ignored] ___________________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env11')> >env = {'PLANET': 'world'}, ini = '[pytest]\nenv = D : R : RESULT = hello_{PLANET}', expected_env = {'RESULT': 'hello_{PLANET}'} >request = <FixtureRequest for <Function test_env[whitespace is ignored]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {'PLANET': 'world'} >expected_env = {'RESULT': 'hello_{PLANET}'} >ini = '[pytest]\nenv = D : R : RESULT = hello_{PLANET}' >request = <FixtureRequest for <Function test_env[whitespace is ignored]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.54s> >test_name = 'whitespace_is_ignored' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env11')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.54s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[31m[1m______________________________________________________ test_env[empty ini works] ______________________________________________________[0m > >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env12')> >env = {'MAGIC': 'zero'}, ini = '', expected_env = {'MAGIC': 'zero'} >request = <FixtureRequest for <Function test_env[empty ini works]>> > > [37m@pytest[39;49;00m.mark.parametrize([90m[39;49;00m > ([33m"[39;49;00m[33menv[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mini[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexpected_env[39;49;00m[33m"[39;49;00m),[90m[39;49;00m > [[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mnew key - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=alpha[39;49;00m[33m\n[39;49;00m[33m SORCERY=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mSORCERY[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo new keys - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > [90m# This test also tests for non-interference of env variables between this test and tests above[39;49;00m[90m[39;49;00m > {},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD flag - add to env[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mbeta[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mkey exists in env - overwrite[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:MAGIC=beta[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33malpha[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mD exists - original val kept[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_world[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mcurly exist - interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mR exists - not interpolate var[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33ma[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mb[39;49;00m[33m\n[39;49;00m[33m D:MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33mc[39;49;00m[33m\n[39;49;00m[33m MAGIC=[39;49;00m[33m{MAGIC}[39;49;00m[33md[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33m{MAGIC}[39;49;00m[33mbd[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mincremental interpolation[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D:R:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = R:D:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mtwo flags - reversed[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = d:r:RESULT=hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mlowercase flags[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mPLANET[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mworld[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m[pytest][39;49;00m[33m\n[39;49;00m[33menv = D : R : RESULT = hello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mRESULT[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mhello_[39;49;00m[33m{PLANET}[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mwhitespace is ignored[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > pytest.param([90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [33m"[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > {[33m"[39;49;00m[33mMAGIC[39;49;00m[33m"[39;49;00m: [33m"[39;49;00m[33mzero[39;49;00m[33m"[39;49;00m},[90m[39;49;00m > [96mid[39;49;00m=[33m"[39;49;00m[33mempty ini works[39;49;00m[33m"[39;49;00m,[90m[39;49;00m > ),[90m[39;49;00m > ],[90m[39;49;00m > )[90m[39;49;00m > [94mdef[39;49;00m [92mtest_env[39;49;00m([90m[39;49;00m > testdir: pytest.Testdir, env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], ini: [96mstr[39;49;00m, expected_env: [96mdict[39;49;00m[[96mstr[39;49;00m, [96mstr[39;49;00m], request: pytest.FixtureRequest[90m[39;49;00m > ) -> [94mNone[39;49;00m:[90m[39;49;00m > test_name = re.sub([33mr[39;49;00m[33m"[39;49;00m[33m\[39;49;00m[33mW|^(?=[39;49;00m[33m\[39;49;00m[33md)[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33m_[39;49;00m[33m"[39;49;00m, request.node.callspec.id).lower()[90m[39;49;00m > Path([96mstr[39;49;00m(testdir.tmpdir / [33mf[39;49;00m[33m"[39;49;00m[33mtest_[39;49;00m[33m{[39;49;00mtest_name[33m}[39;49;00m[33m.py[39;49;00m[33m"[39;49;00m)).symlink_to(Path([91m__file__[39;49;00m).parent / [33m"[39;49;00m[33mtemplate.py[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > (testdir.tmpdir / [33m"[39;49;00m[33mpytest.ini[39;49;00m[33m"[39;49;00m).write_text(ini, encoding=[33m"[39;49;00m[33mutf-8[39;49;00m[33m"[39;49;00m)[90m[39;49;00m > [90m[39;49;00m > [90m# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict[39;49;00m[90m[39;49;00m > [94mwith[39;49;00m mock.patch.dict(os.environ, {**env, [33m"[39;49;00m[33m_TEST_ENV[39;49;00m[33m"[39;49;00m: [96mrepr[39;49;00m(expected_env)}, clear=[94mTrue[39;49;00m):[90m[39;49;00m > result = testdir.runpytest()[90m[39;49;00m > [90m[39;49;00m >> result.assert_outcomes(passed=[94m1[39;49;00m)[90m[39;49;00m > >env = {'MAGIC': 'zero'} >expected_env = {'MAGIC': 'zero'} >ini = '' >request = <FixtureRequest for <Function test_env[empty ini works]>> >result = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.49s> >test_name = 'empty_ini_works' >testdir = <Testdir local('/tmp/portage/dev-python/pytest-env-0.8.1/temp/pytest-of-portage/pytest-0/test_env12')> > >[1m[31m/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1/tests/test_env.py[0m:106: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:567: in parseoutcomes > [94mreturn[39;49;00m [96mself[39;49;00m.parse_summary_nouns([96mself[39;49;00m.outlines)[90m[39;49;00m > self = <RunResult ret=ExitCode.INTERNAL_ERROR len(stdout.lines)=0 len(stderr.lines)=58 duration=0.49s> >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >cls = <class '_pytest.pytester.RunResult'>, lines = [] > > [37m@classmethod[39;49;00m[90m[39;49;00m > [94mdef[39;49;00m [92mparse_summary_nouns[39;49;00m([96mcls[39;49;00m, lines) -> Dict[[96mstr[39;49;00m, [96mint[39;49;00m]:[90m[39;49;00m > [90m [39;49;00m[33m"""Extract the nouns from a pytest terminal summary line.[39;49;00m > [33m[39;49;00m > [33m It always returns the plural noun for consistency::[39;49;00m > [33m[39;49;00m > [33m ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====[39;49;00m > [33m[39;49;00m > [33m Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``.[39;49;00m > [33m """[39;49;00m[90m[39;49;00m > [94mfor[39;49;00m line [95min[39;49;00m [96mreversed[39;49;00m(lines):[90m[39;49;00m > [94mif[39;49;00m rex_session_duration.search(line):[90m[39;49;00m > outcomes = rex_outcome.findall(line)[90m[39;49;00m > ret = {noun: [96mint[39;49;00m(count) [94mfor[39;49;00m (count, noun) [95min[39;49;00m outcomes}[90m[39;49;00m > [94mbreak[39;49;00m[90m[39;49;00m > [94melse[39;49;00m:[90m[39;49;00m >> [94mraise[39;49;00m [96mValueError[39;49;00m([33m"[39;49;00m[33mPytest terminal summary report not found[39;49;00m[33m"[39;49;00m)[90m[39;49;00m >[1m[31mE ValueError: Pytest terminal summary report not found[0m > >cls = <class '_pytest.pytester.RunResult'> >lines = [] > >[1m[31m/usr/lib/python3.10/site-packages/_pytest/pytester.py[0m:585: ValueError >-------------------------------------------------------- Captured stderr call --------------------------------------------------------- >INTERNALERROR> Traceback (most recent call last): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session >INTERNALERROR> config._do_configure() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1056, in _do_configure >INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic >INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec >INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall >INTERNALERROR> return outcome.get_result() >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result >INTERNALERROR> raise ex[1].with_traceback(ex[2]) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall >INTERNALERROR> res = hook_impl.function(*args) >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 101, in pytest_configure >INTERNALERROR> elif backend is None and not has_executable("Xvfb"): >INTERNALERROR> File "/usr/lib/python3.10/site-packages/pytest_xvfb.py", line 34, in has_executable >INTERNALERROR> for path in os.environ["PATH"].split(os.pathsep) >INTERNALERROR> File "/usr/lib/python3.10/os.py", line 680, in __getitem__ >INTERNALERROR> raise KeyError(key) from None >INTERNALERROR> KeyError: 'PATH' >Traceback (most recent call last): > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1170, in runpytest_inprocess > reprec = self.inline_run(*args, **kwargs) > File "/usr/lib/python3.10/site-packages/_pytest/pytester.py", line 1135, in inline_run > ret = main([str(x) for x in args], plugins=plugins) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list >[33m========================================================== warnings summary ===========================================================[0m >tests/test_env.py: 13 warnings >Traceback (most recent call last): > File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main > return _run_code(code, main_globals, None, > File "/usr/lib/python3.10/runpy.py", line 86, in _run_code > exec(code, run_globals) > File "/usr/lib/python3.10/site-packages/pytest/__main__.py", line 5, in <module> > raise SystemExit(pytest.console_main()) > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 189, in console_main > code = main() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main > ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main( > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main > return wrap_session(config, _main) > File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 311, in wrap_session > config._ensure_unconfigure() > File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1061, in _ensure_unconfigure > self.hook.pytest_unconfigure(config=self) > File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__ > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec > return self._inner_hookexec(hook_name, methods, kwargs, firstresult) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall > return outcome.get_result() > File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result > raise ex[1].with_traceback(ex[2]) > File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall > res = hook_impl.function(*args) > File "/usr/lib/python3.10/site-packages/pytest_bdd/plugin.py", line 75, in pytest_unconfigure > CONFIG_STACK.pop() >IndexError: pop from empty list > /usr/lib/python3.10/site-packages/pytest_tornado/plugin.py:70: PytestDeprecationWarning: The hookimpl pytest_pycollect_makeitem uses old-style configuration options (marks or attributes). > Please use the pytest.hookimpl(tryfirst=True) decorator instead > to configure the hooks. > See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers > @pytest.mark.tryfirst > >tests/test_env.py: 13 warnings > /usr/lib/python3.10/site-packages/pytest_tornado/plugin.py:87: PytestDeprecationWarning: The hookimpl pytest_pyfunc_call uses old-style configuration options (marks or attributes). > Please use the pytest.hookimpl(tryfirst=True) decorator instead > to configure the hooks. > See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers > @pytest.mark.tryfirst > >tests/test_env.py: 13 warnings > /usr/lib/python3.10/site-packages/pytest_aiohttp/plugin.py:21: PytestDeprecationWarning: The hookimpl pytest_configure uses old-style configuration options (marks or attributes). > Please use the pytest.hookimpl(tryfirst=True) decorator instead > to configure the hooks. > See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers > @pytest.mark.tryfirst > >tests/test_env.py: 13 warnings > /usr/lib/python3.10/site-packages/snapshottest/pytest.py:87: PytestDeprecationWarning: The hookimpl pytest_configure uses old-style configuration options (marks or attributes). > Please use the pytest.hookimpl(trylast=True) decorator instead > to configure the hooks. > See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers > @pytest.mark.trylast # force the other plugins to initialise, fixes issue with capture not being properly initialised > >tests/test_env.py: 13 warnings > /usr/lib/python3.10/site-packages/pytestskipmarkers/plugin.py:51: PytestDeprecationWarning: The hookimpl pytest_configure uses old-style configuration options (marks or attributes). > Please use the pytest.hookimpl(trylast=True) decorator instead > to configure the hooks. > See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers > @pytest.mark.trylast # type: ignore[misc] > >-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html >[36m[1m======================================================= short test summary info =======================================================[0m >[31mFAILED[0m tests/test_env.py::[1mtest_env[new key - add to env][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[two new keys - add to env][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[D flag - add to env][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[key exists in env - overwrite][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[D exists - original val kept][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[curly exist - interpolate var][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[R exists - not interpolate var][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[incremental interpolation][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[two flags][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[two flags - reversed][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[lowercase flags][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[whitespace is ignored][0m - ValueError: Pytest terminal summary report not found >[31mFAILED[0m tests/test_env.py::[1mtest_env[empty ini works][0m - ValueError: Pytest terminal summary report not found >[31m============================================= [31m[1m13 failed[0m, [32m1 passed[0m, [33m65 warnings[0m[31m in 13.59s[0m[31m ==============================================[0m >pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'. > [31;01m*[0m ERROR: dev-python/pytest-env-0.8.1::gentoo failed (test phase): > [31;01m*[0m pytest failed with python3.10 > [31;01m*[0m > [31;01m*[0m Call stack: > [31;01m*[0m ebuild.sh, line 136: Called src_test > [31;01m*[0m environment, line 3560: Called distutils-r1_src_test > [31;01m*[0m environment, line 1709: Called _distutils-r1_run_foreach_impl 'python_test' > [31;01m*[0m environment, line 762: Called python_foreach_impl 'distutils-r1_run_phase' 'python_test' > [31;01m*[0m environment, line 3208: Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test' > [31;01m*[0m environment, line 2712: Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test' > [31;01m*[0m environment, line 2710: Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_test' > [31;01m*[0m environment, line 1147: Called distutils-r1_run_phase 'python_test' > [31;01m*[0m environment, line 1632: Called python_test > [31;01m*[0m environment, line 3490: Called distutils-r1_python_test > [31;01m*[0m environment, line 1579: Called epytest > [31;01m*[0m environment, line 2228: Called die > [31;01m*[0m The specific snippet of code: > [31;01m*[0m "${@}" || die -n "pytest failed with ${EPYTHON}"; > [31;01m*[0m > [31;01m*[0m If you need support, post the output of `emerge --info '=dev-python/pytest-env-0.8.1::gentoo'`, > [31;01m*[0m the complete build log and the output of `emerge -pqv '=dev-python/pytest-env-0.8.1::gentoo'`. > [31;01m*[0m The complete build log is located at '/var/log/portage/dev-python:pytest-env-0.8.1:20230616-031107.log'. > [31;01m*[0m For convenience, a symlink to the build log is located at '/tmp/portage/dev-python/pytest-env-0.8.1/temp/build.log'. > [31;01m*[0m The ebuild environment file is located at '/tmp/portage/dev-python/pytest-env-0.8.1/temp/environment'. > [31;01m*[0m Working directory: '/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1' > [31;01m*[0m S: '/tmp/portage/dev-python/pytest-env-0.8.1/work/pytest_env-0.8.1'
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 908560
: 863891