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

Cannot get test with @pytest.mark.record_http to work #2

Open
mmistroni opened this issue May 20, 2024 · 0 comments
Open

Cannot get test with @pytest.mark.record_http to work #2

mmistroni opened this issue May 20, 2024 · 0 comments

Comments

@mmistroni
Copy link

Hello
i am having issues in getting this pytest recorder to work correctly, not sure if i need to install anything in particular
here's a simple test,called test_httpplugin.py

import pytest
import requests

@pytest.mark.record_http
def test_some_test(record):
requests.get('http://www.google.com')

running it like this result in an error as the record_http extension is not recognized

(openbb-mmistroni) PS C:\Users\Marco And Sofia\OpenBB\OpenBB_Experiments\openbb-mmprvds\tests> pytest -s test_httpplugin.py --record
C:\Users\Marco\envs\openbb-mmistroni\Lib\site-packages_pytest\config_init_.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
UsageError: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --record
inifile: C:\Users\Marco And Sofia\OpenBB\OpenBB_Experiments\openbb-mmprvds\tests\pytest.ini
rootdir: C:\Users\Marco And Sofia\OpenBB\OpenBB_Experiments\openbb-mmprvds\tests
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
config = pluginmanager.hook.pytest_cmdline_parse(
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --record
inifile: C:\Users\Marco And Sofia\OpenBB\OpenBB_Experiments\openbb-mmprvds\tests\pytest.ini
rootdir: C:\Users\Marco And Sofia\OpenBB\OpenBB_Experiments\openbb-mmprvds\tests

Would you be able to help?
Kind regards
Marco

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

No branches or pull requests

1 participant