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_records_new_interaction fails #212

Open
mtelka opened this issue Jul 12, 2024 · 6 comments
Open

test_records_new_interaction fails #212

mtelka opened this issue Jul 12, 2024 · 6 comments
Labels

Comments

@mtelka
Copy link

mtelka commented Jul 12, 2024

_________________ TestRecordOnce.test_records_new_interaction __________________

self = <tests.integration.test_record_modes.TestRecordOnce testMethod=test_records_new_interaction>

    def test_records_new_interaction(self):
        s = self.session
        with Betamax(s).use_cassette('test_record_once') as betamax:
            self.cassette_path = betamax.current_cassette.cassette_path
>           assert betamax.current_cassette.is_empty() is True
E           assert False is True
E            +  where False = <bound method Cassette.is_empty of <betamax.cassette.cassette.Cassette object at 0x7fffad73e340>>()
E            +    where <bound method Cassette.is_empty of <betamax.cassette.cassette.Cassette object at 0x7fffad73e340>> = <betamax.cassette.cassette.Cassette object at 0x7fffad73e340>.is_empty
E            +      where <betamax.cassette.cassette.Cassette object at 0x7fffad73e340> = <betamax.recorder.Betamax object at 0x7fffad73ef70>.current_cassette

tests/integration/test_record_modes.py:13: AssertionError
@sigmavirus24
Copy link
Collaborator

This test does not fail for me or in CI

@mtelka
Copy link
Author

mtelka commented Jul 15, 2024

Here are steps to reproduce:

$ wget https://github.com/betamaxpy/betamax/archive/refs/tags/0.9.0.tar.gz
$ gtar xf 0.9.0.tar.gz
$ cd betamax-0.9.0
$ tox -e py39
py39: install_deps> python -I -m pip install mock pytest 'requests>=2.0'
.pkg: install_requires> python -I -m pip install 'setuptools>=40.8.0' wheel
.pkg: _optional_hooks> python /usr/lib/python3.9/vendor-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_sdist> python /usr/lib/python3.9/vendor-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_wheel> python /usr/lib/python3.9/vendor-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: install_requires_for_build_wheel> python -I -m pip install wheel
.pkg: prepare_metadata_for_build_wheel> python /usr/lib/python3.9/vendor-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: build_sdist> python /usr/lib/python3.9/vendor-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
py39: install_package_deps> python -I -m pip install 'requests>=2.0'
py39: install_package> python -I -m pip install --force-reinstall --no-deps /tmp/test/betamax-0.9.0/.tox/.tmp/package/1/betamax-0.9.0.tar.gz
py39: commands[0]> py.test
...................F...............................................................................................................................                                                                                [100%]
================================================================================================================ FAILURES ================================================================================================================
______________________________________________________________________________________________ TestRecordOnce.test_records_new_interaction _______________________________________________________________________________________________

self = <tests.integration.test_record_modes.TestRecordOnce testMethod=test_records_new_interaction>

    def test_records_new_interaction(self):
        s = self.session
        with Betamax(s).use_cassette('test_record_once') as betamax:
            self.cassette_path = betamax.current_cassette.cassette_path
>           assert betamax.current_cassette.is_empty() is True
E           assert False is True
E            +  where False = <bound method Cassette.is_empty of <betamax.cassette.cassette.Cassette object at 0x7fffadbeba00>>()
E            +    where <bound method Cassette.is_empty of <betamax.cassette.cassette.Cassette object at 0x7fffadbeba00>> = <betamax.cassette.cassette.Cassette object at 0x7fffadbeba00>.is_empty
E            +      where <betamax.cassette.cassette.Cassette object at 0x7fffadbeba00> = <betamax.recorder.Betamax object at 0x7fffadb921f0>.current_cassette

tests/integration/test_record_modes.py:13: AssertionError
============================================================================================================ warnings summary ============================================================================================================
tests/integration/test_fixtures.py::TestPyTestParametrizedFixtures::test_pytest_fixture[https://httpbin.org/get]
tests/integration/test_fixtures.py::test_pytest_parametrize_with_filesystem_problematic_chars[aaa\\bbb]
tests/integration/test_fixtures.py::test_pytest_parametrize_with_filesystem_problematic_chars[ccc:ddd]
tests/integration/test_fixtures.py::test_pytest_parametrize_with_filesystem_problematic_chars[eee*fff]
  /tmp/test/betamax-0.9.0/.tox/py39/lib/python3.9/site-packages/betamax/fixtures/pytest.py:128: DeprecationWarning: betamax_parametrized_recorder and betamax_parametrized_session will be removed in betamax 1.0. Their behavior will be the default.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================================================================== short test summary info =========================================================================================================
FAILED tests/integration/test_record_modes.py::TestRecordOnce::test_records_new_interaction - assert False is True
1 failed, 146 passed, 4 warnings in 14.36s
py39: exit 1 (15.45 seconds) /tmp/test/betamax-0.9.0> py.test pid=10301
  py39: FAIL code 1 (35.56=setup[20.11]+cmd[15.45] seconds)
  evaluation failed :( (36.61 seconds)
$

@mtelka
Copy link
Author

mtelka commented Jul 15, 2024

BTW, tested on both OpenIndiana and Rocky Linux 9.4 with same results.

@sigmavirus24
Copy link
Collaborator

Can you ls tests/cassettes/ from within betamax-0.9.0?

@sigmavirus24 sigmavirus24 reopened this Jul 15, 2024
@mtelka
Copy link
Author

mtelka commented Jul 15, 2024

$ ls tests/cassettes/
 FakeBetamaxTestCase.test_fake.json
 GitHub_create_issue.json
 GitHub_emojis.json
 global_preserve_exact_body_bytes.json
 handles_digest_auth.json
 once_record_mode.json
 preserve_exact_bytes.json
 replay_interactions.json
 replay_multiple_times.json
 test.json
 test-multiple-cookies-regression.json
 test_record_once.json
 test_replays_response_on_right_order.json
 tests.integration.test_fixtures.TestPyTestFixtures.test_pytest_fixture.json
'tests.integration.test_fixtures.TestPyTestParametrizedFixtures.test_pytest_fixture[https---httpbin.org-get].json'
'tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[aaa-bbb].json'
'tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[ccc-ddd].json'
'tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[eee-fff].json'
$

@sigmavirus24
Copy link
Collaborator

Ah looks like this was fixed after 0.9.0 e3331c5 but needs a release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants