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

v2023.12.0 - Testing Tab - pytest no results with VCR --block-network #21645

Closed
nitsujri opened this issue Jul 17, 2023 · 10 comments
Closed

v2023.12.0 - Testing Tab - pytest no results with VCR --block-network #21645

nitsujri opened this issue Jul 17, 2023 · 10 comments
Assignees

Comments

@nitsujri
Copy link

nitsujri commented Jul 17, 2023

Type: Bug

Behaviour

Expected vs. Actual

VSCode's Test panel results no longer report test results after upgrading to version 2023.12.0.

Reproducibly works in 2023.10.1

Steps to reproduce:

  1. Install VSCode, VSCode Python extension (latest, 2023.12.0), pytest (7.4.0), pytest-recording.
  2. in pytest.ini
[pytest]
addopts = --block-network
  1. Any specs do not post results - always a grey circle regardless of pass/fail (see image below).
  2. Downgrade Python extension to 2023.10.1 (must click on Testing tab after reloading VSCode to pickup specs).
  3. Run same test and obtain results as shown below (green check).
Cursor_and_test_forms_py_—_nellie-app

[UPDATE] I discovered I have to go back to 2023.08.0 to get the proper output otherwise, see images below:

test_integration_create_py_—_nellie-app

2023.10.1 - Broken output "Passed here" repeated

test_integration_create_py_—_nellie-app

2023.08.0 - Proper working output


Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.4
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Poetry
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

formatting
• provider: "black"

testing
• pytestEnabled: true

Extension version: 2023.10.1
VS Code version: Code 1.80.1 (Universal) (74f6148eb9ea00507ec113ec51c489d6ffb4b771, 2023-07-12T17:20:23.298Z)
OS version: Darwin arm64 22.5.0
Modes:

System Info
Item Value
CPUs Apple M1 Pro (8 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 2, 3, 3
Memory (System) 16.00GB (0.06GB free)
Process Argv . --crash-reporter-id 8cf5ee63-cd23-4d2f-8c26-1df9fa611273
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
py29gd2263:30789496
vscaac:30438847
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vsccc:30610678
282f8724:30602487
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
2i9eh265:30646982
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
03d35959:30757346
24365598:30736109
pythonfmttext:30731395
pythoncmv:30756943
fixshowwlkth:30771522
showindicator:30785052
pythongtdpath:30769146
i26e3531:30780429
pythonnosm12tcf:30779713
pythonidxpt:30784022
pythonnoceb:30776495
e537b577:30786199
dsvsc013cf:30789518

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jul 17, 2023
@eleanorjboyd
Copy link
Member

Thank you for your issue report. We are looking into this now! In the meantime, you are likely on the new testing rewrite and this is why you saw a change in behavior since we just moved to this experiment to a larger group of people receiving it. You can opt out of the rewrite as I get this fix in by setting this in your user settings: "python.experiments.optOutFrom": ["pythonTestAdapter"],. Let me know if that is a fix for you. Thanks!

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 17, 2023
@nitsujri
Copy link
Author

@eleanorjboyd that was it! works like I expect now on 2023.12.0

Thanks! happy to help if there's anything else I can test; otherwise, feel free to close.

@nitsujri
Copy link
Author

Looks like the test got expanded even further. Another one of our engineers in Vietnam hit this issue yesterday as mentioned in #22192. We thought it might be related but guess not.

While it looks like that issue was fixed, I tested just now and ours still persists. If I remove "python.experiments.optOutFrom": ["pythonTestAdapter"] then I get an empty test result. This is true on 2023.18.0 and pre-release v2023.19.12991923 which I believe contains the fix (but i'm not 100% sure how to tell).

Happy to test anyway I can.

@eleanorjboyd
Copy link
Member

Hi @nitsujri, are you still seeing this? If so can you set log level to trace (via the command palette "developer: set log level...) and then set me the logs to the "python" output channel. Also a description of your workspace setup would be helpful. Thanks

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 30, 2023
@nitsujri
Copy link
Author

Thanks so much!

Running the latest pre-release v2023.19.13031019. I get a new error:

Test Result Tab

CLIENT: Server listening on port 59885...
Received JSON data in run script
============================= test session starts ==============================
platform darwin -- Python 3.11.6, pytest-7.4.2, pluggy-1.3.0
Using --randomly-seed=1592213212
django: settings: config.environments.test (from option)
rootdir: /Users/justin/dev/nellie/nellie-app
configfile: pytest.ini
plugins: anyio-4.0.0, randomly-3.15.0, recording-0.12.2, Faker-19.10.0, django-4.5.2, sugar-0.9.7
collected 1 item

apps/utils/tests/test_moenyed_fx.py Error attempting to connect to extension communication socket[vscode-pytest]: nothing to repeat at position 1
If you are on a Windows machine, this error may be occurring if any of your tests clear environment variables as they are required to communicate with the extension. Please reference https://docs.pytest.org/en/stable/how-to/monkeypatch.html#monkeypatching-environment-variablesfor the correct way to clear environment variables during testing.


INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/vscode_pytest/__init__.py", line 721, in send_post_request
INTERNALERROR>     __socket.connect()
INTERNALERROR>   File "/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/testing_tools/socket_manager.py", line 40, in connect
INTERNALERROR>     self.socket.connect(self.addr)
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pytest_recording/network.py", line 123, in network_guard
INTERNALERROR>     if is_host_in_allowed_hosts(host, allowed_hosts):
INTERNALERROR>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pytest_recording/network.py", line 168, in is_host_in_allowed_hosts
INTERNALERROR>     return bool(re.match(combined, to_string(host)))
INTERNALERROR>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/__init__.py", line 166, in match
INTERNALERROR>     return _compile(pattern, flags).match(string)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/__init__.py", line 294, in _compile
INTERNALERROR>     p = _compiler.compile(pattern, flags)
INTERNALERROR>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_compiler.py", line 743, in compile
INTERNALERROR>     p = _parser.parse(p, flags)
INTERNALERROR>         ^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_parser.py", line 982, in parse
INTERNALERROR>     p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
INTERNALERROR>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_parser.py", line 457, in _parse_sub
INTERNALERROR>     itemsappend(_parse(source, state, verbose, nested + 1,
INTERNALERROR>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_parser.py", line 865, in _parse
INTERNALERROR>     p = _parse_sub(source, state, sub_verbose, nested + 1)
INTERNALERROR>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_parser.py", line 457, in _parse_sub
INTERNALERROR>     itemsappend(_parse(source, state, verbose, nested + 1,
INTERNALERROR>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_parser.py", line 684, in _parse
INTERNALERROR>     raise source.error("nothing to repeat",
INTERNALERROR> re.error: nothing to repeat at position 1
INTERNALERROR> 
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/_pytest/main.py", line 271, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>                          ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/_pytest/main.py", line 325, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 152, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 114, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/_pytest/main.py", line 350, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 152, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 114, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 114, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 133, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 226, in call_and_report
INTERNALERROR>     hook.pytest_runtest_logreport(report=report)
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 113, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/_pytest/terminal.py", line 574, in pytest_runtest_logreport
INTERNALERROR>     *self.config.hook.pytest_report_teststatus(report=rep, config=self.config)
INTERNALERROR>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 152, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 114, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 62, in _multicall
INTERNALERROR>     next(wrapper_gen)  # first yield
INTERNALERROR>     ^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/vscode_pytest/__init__.py", line 233, in pytest_report_teststatus
INTERNALERROR>     execution_post(
INTERNALERROR>   File "/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/vscode_pytest/__init__.py", line 660, in execution_post
INTERNALERROR>     send_post_request(payload)
INTERNALERROR>   File "/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/vscode_pytest/__init__.py", line 732, in send_post_request
INTERNALERROR>     raise VSCodePytestError(error_msg)
INTERNALERROR> vscode_pytest.VSCodePytestError: Error attempting to connect to extension communication socket[vscode-pytest]: nothing to repeat at position 1
Error attempting to connect to extension communication socket[vscode-pytest]: nothing to repeat at position 1
If you are on a Windows machine, this error may be occurring if any of your tests clear environment variables as they are required to communicate with the extension. Please reference https://docs.pytest.org/en/stable/how-to/monkeypatch.html#monkeypatching-environment-variablesfor the correct way to clear environment variables during testing.

Traceback (most recent call last):
  File "/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/vscode_pytest/__init__.py", line 721, in send_post_request
    __socket.connect()
  File "/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/testing_tools/socket_manager.py", line 40, in connect
    self.socket.connect(self.addr)
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pytest_recording/network.py", line 123, in network_guard
    if is_host_in_allowed_hosts(host, allowed_hosts):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pytest_recording/network.py", line 168, in is_host_in_allowed_hosts
    return bool(re.match(combined, to_string(host)))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/__init__.py", line 166, in match
    return _compile(pattern, flags).match(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/__init__.py", line 294, in _compile
    p = _compiler.compile(pattern, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_compiler.py", line 743, in compile
    p = _parser.parse(p, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_parser.py", line 982, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_parser.py", line 457, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_parser.py", line 865, in _parse
    p = _parse_sub(source, state, sub_verbose, nested + 1)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_parser.py", line 457, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/re/_parser.py", line 684, in _parse
    raise source.error("nothing to repeat",
re.error: nothing to repeat at position 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/vscode_pytest/run_pytest_script.py", line 67, in <module>
    pytest.main(arg_array)
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/_pytest/config/__init__.py", line 169, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 113, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/_pytest/main.py", line 318, in pytest_cmdline_main
    return wrap_session(config, _main)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/_pytest/main.py", line 306, in wrap_session
    config.hook.pytest_sessionfinish(
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 130, in _multicall
    teardown[0].send(outcome)
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/_pytest/terminal.py", line 857, in pytest_sessionfinish
    outcome.get_result()
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 114, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/Users/justin/dev/nellie/nellie-app/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/vscode_pytest/__init__.py", line 367, in pytest_sessionfinish
    execution_post(
  File "/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/vscode_pytest/__init__.py", line 660, in execution_post
    send_post_request(payload)
  File "/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/vscode_pytest/__init__.py", line 732, in send_post_request
    raise VSCodePytestError(error_msg)
vscode_pytest.VSCodePytestError: Error attempting to connect to extension communication socket[vscode-pytest]: nothing to repeat at position 1
Finished running tests!

Output of Python - Trace level

2023-10-31 08:11:58.229 [debug] Clearing context for python dependencies not installed: undefined
2023-10-31 08:11:58.243 [debug] Found cached env for /Users/justin/dev/nellie/nellie-app/.venv/bin/python
2023-10-31 08:11:58.243 [debug] Resolved /Users/justin/dev/nellie/nellie-app/.venv/bin/python from cache: {"name":".venv","location":"/Users/justin/dev/nellie/nellie-app/.venv","kind":"poetry","executable":{"filename":"/Users/justin/dev/nellie/nellie-app/.venv/bin/python","sysPrefix":"/Users/justin/dev/nellie/nellie-app/.venv","ctime":1687068552236,"mtime":1687068552236},"searchLocation":{"$mid":1,"path":"/Users/justin/dev/nellie/nellie-app/.venv","scheme":"file"},"display":"Python 3.11.6 ('.venv': Poetry)","version":{"major":3,"minor":11,"micro":6,"release":{"level":"final","serial":0},"sysVersion":"3.11.6 (main, Oct  2 2023, 13:45:54) [Clang 15.0.0 (clang-1500.0.40.1)]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/Users/justin/dev/nellie/nellie-app/.venv/bin/python","detailedDisplayName":"Python 3.11.6 ('.venv': Poetry)"}
2023-10-31 08:11:58.245 [debug] Found cached env for /Users/justin/dev/nellie/nellie-app/.venv/bin/python
2023-10-31 08:11:58.245 [debug] Resolved /Users/justin/dev/nellie/nellie-app/.venv/bin/python from cache: {"name":".venv","location":"/Users/justin/dev/nellie/nellie-app/.venv","kind":"poetry","executable":{"filename":"/Users/justin/dev/nellie/nellie-app/.venv/bin/python","sysPrefix":"/Users/justin/dev/nellie/nellie-app/.venv","ctime":1687068552236,"mtime":1687068552236},"searchLocation":{"$mid":1,"path":"/Users/justin/dev/nellie/nellie-app/.venv","scheme":"file"},"display":"Python 3.11.6 ('.venv': Poetry)","version":{"major":3,"minor":11,"micro":6,"release":{"level":"final","serial":0},"sysVersion":"3.11.6 (main, Oct  2 2023, 13:45:54) [Clang 15.0.0 (clang-1500.0.40.1)]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/Users/justin/dev/nellie/nellie-app/.venv/bin/python","detailedDisplayName":"Python 3.11.6 ('.venv': Poetry)"}
2023-10-31 08:11:58.246 [info] Server listening on port 59929
2023-10-31 08:11:58.246 [debug] Server started for pytest test ids server and listening on port 59929
2023-10-31 08:11:58.248 [info] All environment variables set for pytest execution: {"COMPOSE_FILE":"docker/docker-compose.local.yml","ESIGN_TEST_SIGNER_EMAIL":"[email protected]","COLORFGBG":"7;0","COLORTERM":"truecolor","COMMAND_MODE":"unix2003","CPPFLAGS":"-I/opt/homebrew/opt/libffi/include","DISABLE_DATABASE_ENVIRONMENT_CHECK":"true","DISABLE_PRY_RAILS":"true","EDITOR":"vim","ELECTRON_NO_ATTACH_CONSOLE":"1","HOME":"/Users/justin","HOMEBREW_CELLAR":"/opt/homebrew/Cellar","HOMEBREW_PREFIX":"/opt/homebrew","HOMEBREW_REPOSITORY":"/opt/homebrew","INFOPATH":"/opt/homebrew/share/info:/opt/homebrew/share/info:","ITERM_PROFILE":"Default","ITERM_SESSION_ID":"w0t3p0:CC668EA9-482F-4AA8-9A3F-124A8FBF36B0","LANG":"en_US.UTF-8","LC_TERMINAL":"iTerm2","LC_TERMINAL_VERSION":"3.4.12","LDFLAGS":"-L/opt/homebrew/opt/libffi/lib","LESS":"-R","LOGNAME":"justin","LSCOLORS":"Gxfxcxdxbxegedabagacad","LaunchInstanceID":"B3F059A7-7605-4E1A-9770-9A34BFE4FCBF","MANPATH":"/opt/homebrew/share/man:/opt/homebrew/share/man:::","MallocNanoZone":"0","N_PREFIX":"/Users/justin/.n","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","P9K_SSH":"0","P9K_TTY":"old","PAGER":"less","PKG_CONFIG_PATH":"/opt/homebrew/opt/libffi/lib/pkgconfig","POETRY_ACTIVE":"1","PWD":"/Users/justin/dev/nellie/nellie-app","RBENV_SHELL":"zsh","RUBY_CONFIGURE_OPTS":"--with-openssl-dir=/opt/homebrew/opt/[email protected]","SDKMAN_DIR":"/Users/justin/.sdkman","SECURITYSESSIONID":"186ab","SHELL":"/bin/zsh","SHLVL":"3","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.S1BhKzcPJC/Listeners","TERM":"xterm-256color","TERM_PROGRAM":"iTerm.app","TERM_PROGRAM_VERSION":"3.4.12","TERM_SESSION_ID":"w0t3p0:CC668EA9-482F-4AA8-9A3F-124A8FBF36B0","TMPDIR":"/var/folders/5b/8nyh0fh160z33c2s5rcvf9dh0000gn/T/","USER":"justin","VIRTUAL_ENV":"/Users/justin/dev/nellie/nellie-app/.venv","VISUAL":"vim","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_CLI":"1","VSCODE_CODE_CACHE_PATH":"/Users/justin/Library/Application Support/Code/CachedData/f1b07bd25dfad64b0167beb15359ae573aecd2cc","VSCODE_CRASH_REPORTER_PROCESS_TYPE":"extensionHost","VSCODE_CWD":"/Users/justin/dev/nellie/nellie-app","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_IPC_HOOK":"/Users/justin/Library/Application Support/Code/1.83-main.sock","VSCODE_NLS_CONFIG":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_PID":"1112","XPC_FLAGS":"0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCode.147153543.147153549.889EC916-F4C1-4A93-B2C9-C07B5E173659","ZSH":"/Users/justin/.oh-my-zsh","_P9K_TTY":"/dev/ttys016","__CFBundleIdentifier":"com.microsoft.VSCode","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","ELECTRON_RUN_AS_NODE":"1","PATH":"/Users/justin/dev/nellie/nellie-app/.venv/bin:/Users/justin/.poetry/bin:/Users/justin/.yarn/bin:/Users/justin/.config/yarn/global/node_modules/.bin:/Users/justin/.n/bin:/usr/local/bin/rubocop-daemon-wrapper:/Users/justin/.pyenv/shims:/Users/justin/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/sbin:/Users/justin/.poetry/bin:/Users/justin/.yarn/bin:/Users/justin/.config/yarn/global/node_modules/.bin:/Users/justin/.n/bin:/usr/local/bin/rubocop-daemon-wrapper:/Users/justin/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin","PYTHONPATH":"/Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles","TEST_UUID":"403eead4-c5b8-4c56-a024-535d8d3df029","TEST_PORT":"59837","RUN_TEST_IDS_PORT":"59929"}
2023-10-31 08:11:58.248 [info] Running pytest with arguments: /Users/justin/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/vscode_pytest/run_pytest_script.py --rootdir /Users/justin/dev/nellie/nellie-app

2023-10-31 08:11:58.248 [info] > ./.venv/bin/python ~/.vscode/extensions/ms-python.python-2023.19.12991923/pythonFiles/vscode_pytest/run_pytest_script.py --rootdir .
2023-10-31 08:11:58.248 [info] cwd: .
2023-10-31 08:11:59.843 [info] Client disconnected
2023-10-31 08:11:59.927 [error] Subprocess exited unsuccessfully with exit code 1 and signal null.
2023-10-31 08:11:59.928 [debug] Test run finished, subprocess closed.
2023-10-31 08:11:59.928 [error] Subprocess closed unsuccessfully with exit code 1 and signal null. Creating and sending error execution payload
2023-10-31 08:11:59.928 [info] ResultResolver EOT received for execution.
2023-10-31 08:11:59.928 [debug] deferredTill EOT resolved
2023-10-31 08:11:59.928 [info] Disposing data receiver for /Users/justin/dev/nellie/nellie-app and deleting UUID; pytest execution.
2023-10-31 08:12:01.870 [debug] Clearing context for python dependencies not installed: ms-python.python.Python
2023-10-31 08:12:01.871 [debug] Found cached env for /Users/justin/dev/nellie/nellie-app/.venv/bin/python
2023-10-31 08:12:01.871 [debug] Resolved /Users/justin/dev/nellie/nellie-app/.venv/bin/python from cache: {"name":".venv","location":"/Users/justin/dev/nellie/nellie-app/.venv","kind":"poetry","executable":{"filename":"/Users/justin/dev/nellie/nellie-app/.venv/bin/python","sysPrefix":"/Users/justin/dev/nellie/nellie-app/.venv","ctime":1687068552236,"mtime":1687068552236},"searchLocation":{"$mid":1,"path":"/Users/justin/dev/nellie/nellie-app/.venv","scheme":"file"},"display":"Python 3.11.6 ('.venv': Poetry)","version":{"major":3,"minor":11,"micro":6,"release":{"level":"final","serial":0},"sysVersion":"3.11.6 (main, Oct  2 2023, 13:45:54) [Clang 15.0.0 (clang-1500.0.40.1)]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/Users/justin/dev/nellie/nellie-app/.venv/bin/python","detailedDisplayName":"Python 3.11.6 ('.venv': Poetry)"}
2023-10-31 08:12:01.871 [debug] Cached data exists KeyPrefix=Cache_Method_Output__.ensureEnvironmentContainsPython-Args="/Users/justin/dev/nellie/nellie-app/.venv/bin/python"-Arg-Separator-undefined

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Oct 31, 2023
@nitsujri
Copy link
Author

@eleanorjboyd oh i found it! it's related to the original problem --block-network

If I remove this from my pytest.ini it works as expected.

The specific library we're using for this function: https://github.com/kiwicom/pytest-recording

@eleanorjboyd
Copy link
Member

aha great find! What is your use case for --block-network? We would have to provide a fallback design to handle this case and are trying to understand the use case. Thanks!

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Nov 1, 2023
@eleanorjboyd
Copy link
Member

seems the same issue as #22383, around network settings. Lmk if you think they are different. If you think they are the same I might close this one to keep the conversation in one place and move it there. Thanks

@johnchristopherjones
Copy link

IMO, they're the same underlying problem. Both pytest_socket and pytest-recording block networking the same way: by monkey-patching socket.socket during runtime.

@eleanorjboyd
Copy link
Member

ok then lets close this issue and move all conversation there on if there is a solution to both these networking conflicts. Thanks

@eleanorjboyd eleanorjboyd closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2023
@eleanorjboyd eleanorjboyd removed info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team labels Nov 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants