Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_replace_env_var_circular_flip_flop failing #3011

Open
mcepl opened this issue May 10, 2023 · 1 comment
Open

test_replace_env_var_circular_flip_flop failing #3011

mcepl opened this issue May 10, 2023 · 1 comment
Labels
help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.

Comments

@mcepl
Copy link

mcepl commented May 10, 2023

Issue

When packaging tox 4.5.1 from the PyPI tarball for openSUSE/Factory, test_replace_env_var_circular_flip_flop fails (among other problems, see complete build log.txt):

[   74s] =================================== FAILURES ===================================
[   74s] ___________________ test_replace_env_var_circular_flip_flop ____________________
[   74s] [gw0] linux -- Python 3.9.16 /home/abuild/rpmbuild/BUILD/tox-4.5.1/testenv-3.9/bin/python
[   74s] 
[   74s] replace_one = <function replace_one.<locals>.example at 0x7fc8b3f53550>
[   74s] monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fc8c0249460>
[   74s] caplog = <_pytest.logging.LogCaptureFixture object at 0x7fc8c08fbd00>
[   74s] 
[   74s]     @pytest.mark.usefixtures("reset_env_var_after_delay")
[   74s]     def test_replace_env_var_circular_flip_flop(
[   74s]         replace_one: ReplaceOne,
[   74s]         monkeypatch: MonkeyPatch,
[   74s]         caplog: LogCaptureFixture,
[   74s]     ) -> None:
[   74s]         """Replacement values will not infinitely loop back and forth"""
[   74s]         monkeypatch.setenv("TRAGIC", "{env:MAGIC}")
[   74s]         monkeypatch.setenv("MAGIC", "{env:TRAGIC}")
[   74s]         result = replace_one("{env:MAGIC}")
[   74s]         assert result == "{env:MAGIC}"
[   74s] >       assert "circular chain between set env MAGIC, TRAGIC" in caplog.messages
[   74s] E       AssertionError: assert 'circular chain between set env MAGIC, TRAGIC' in []
[   74s] E        +  where [] = <_pytest.logging.LogCaptureFixture object at 0x7fc8c08fbd00>.messages
[   74s] 
[   74s] caplog     = <_pytest.logging.LogCaptureFixture object at 0x7fc8c08fbd00>
[   74s] monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fc8c0249460>
[   74s] replace_one = <function replace_one.<locals>.example at 0x7fc8b3f53550>
[   74s] result     = '{env:MAGIC}'
[   74s] 
[   74s] tests/config/loader/ini/replace/test_replace_env_var.py:124: AssertionError
[   74s] __________________ test_replace_env_var_circular_flip_flop_5 ___________________
[   74s] [gw0] linux -- Python 3.9.16 /home/abuild/rpmbuild/BUILD/tox-4.5.1/testenv-3.9/bin/python
[   74s] 
[   74s] replace_one = <function replace_one.<locals>.example at 0x7fc8b348d670>
[   74s] monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fc8c06e17f0>
[   74s] caplog = <_pytest.logging.LogCaptureFixture object at 0x7fc8c032a340>
[   74s] 
[   74s]     @pytest.mark.usefixtures("reset_env_var_after_delay")
[   74s]     def test_replace_env_var_circular_flip_flop_5(
[   74s]         replace_one: ReplaceOne,
[   74s]         monkeypatch: MonkeyPatch,
[   74s]         caplog: LogCaptureFixture,
[   74s]     ) -> None:
[   74s]         """Replacement values will not infinitely loop back and forth (longer chain)"""
[   74s]         monkeypatch.setenv("MAGIC", "{env:TRAGIC}")
[   74s]         monkeypatch.setenv("TRAGIC", "{env:RABBIT}")
[   74s]         monkeypatch.setenv("RABBIT", "{env:HAT}")
[   74s]         monkeypatch.setenv("HAT", "{env:TRICK}")
[   74s]         monkeypatch.setenv("TRICK", "{env:MAGIC}")
[   74s]         result = replace_one("{env:MAGIC}")
[   74s]         assert result == "{env:MAGIC}"
[   74s] >       assert "circular chain between set env MAGIC, TRAGIC, RABBIT, HAT, TRICK" in caplog.messages
[   74s] E       AssertionError: assert 'circular chain between set env MAGIC, TRAGIC, RABBIT, HAT, TRICK' in []
[   74s] E        +  where [] = <_pytest.logging.LogCaptureFixture object at 0x7fc8c032a340>.messages
[   74s] 
[   74s] caplog     = <_pytest.logging.LogCaptureFixture object at 0x7fc8c032a340>
[   74s] monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fc8c06e17f0>
[   74s] replace_one = <function replace_one.<locals>.example at 0x7fc8b348d670>
[   74s] result     = '{env:MAGIC}'
[   74s] 
[   74s] tests/config/loader/ini/replace/test_replace_env_var.py:141: AssertionError
[   74s] =========================== short test summary info ============================
[   74s] SKIPPED [1] tests/test_provision.py:162: integration tests not run (no --run-integration flag)
[   74s] SKIPPED [1] tests/test_provision.py:219: integration tests not run (no --run-integration flag)
[   74s] SKIPPED [2] tests/test_provision.py:228: integration tests not run (no --run-integration flag)
[   74s] SKIPPED [2] tests/test_provision.py:196: integration tests not run (no --run-integration flag)
[   74s] SKIPPED [1] tests/test_provision.py:129: integration tests not run (no --run-integration flag)
[   74s] SKIPPED [1] tests/tox_env/python/virtual_env/test_setuptools.py:16: integration tests not run (no --run-integration flag)
[   74s] SKIPPED [1] tests/session/cmd/test_sequential.py:158: integration tests not run (no --run-integration flag)
[   74s] SKIPPED [1] tests/session/cmd/test_sequential.py:57: integration tests not run (no --run-integration flag)
[   74s] SKIPPED [1] tests/session/cmd/test_devenv.py:15: integration tests not run (no --run-integration flag)
[   74s] FAILED tests/config/loader/ini/replace/test_replace_env_var.py::test_replace_env_var_circular_flip_flop
[   74s] FAILED tests/config/loader/ini/replace/test_replace_env_var.py::test_replace_env_var_circular_flip_flop_5
[   74s] ================= 2 failed, 1609 passed, 11 skipped in 55.71s ==================

Environment

Provide at least:

  • OS: openSUSE/Tumbleweed
  • pip list of the host Python where tox is installed (see above log for the list), but it is also pip-list.txt.

Output of running tox

Provide the output of tox -rvv:

see above

Minimal example

Just running the test suite (see above in the build log for details).

@gaborbernat gaborbernat added the help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. label Jun 16, 2023
@gaborbernat
Copy link
Member

PR welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Projects
None yet
Development

No branches or pull requests

2 participants