Escape test ID`s in Testing API
See original GitHub issueI have Python project with pytest’s tests and I catch this error
Error: Test IDs may not include the "<path-to-test>/tests/unit/interactions/mastercard/test_mastercard.py::TestMasterCardDeleteCard::test_generic_404_exception_is_not_affected[\u0000]" symbol
at new D (vscode-file://vscode-app/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87)
at Object.createTestItem (vscode-file://vscode-app/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:95)
at vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9
at vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9
at Array.forEach (<anonymous>)
at g (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at m (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9
at Object.forEach (vscode-file://vscode-app/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87)
at g (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at m (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9
at Object.forEach (vscode-file://vscode-app/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87)
at g (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at m (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9
at Object.forEach (vscode-file://vscode-app/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87)
at g (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at m (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9
at Object.forEach (vscode-file://vscode-app/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87)
at g (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at m (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9
at Object.forEach (vscode-file://vscode-app/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87)
at g (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at Object.m [as updateTestItemFromRawData] (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9)
at _.resolveChildren (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:59)
at _.refreshTestData (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:59)
at processTicksAndRejections (internal/process/task_queues.js:93)
at async v.refreshTestDataInternal (vscode-file://vscode-app/Users/perseus/.vscode/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:59)
Pytest allow to parametrize and test looks like this
@pytest.mark.asyncio
@pytest.mark.parametrize('body', ['', 'test', '{}', '{"test": true}', b'', b'\x00'])
async def test_generic_404_exception_is_not_affected(
-> test_generic_404_exception_is_not_affected[\u0000]
is valid test name
Version: 1.61.2
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
react-testing-library why use test id - Stack Overflow
Use a testid if you have to. I was wondering why this is a bad practice. I do not want to litter my...
Read more >About Queries | Testing Library
Note that using this as an escape hatch to query by class or id is not recommended because they are invisible to the...
Read more >How to Test your GraphQL Endpoints
Tutorial. How to Test your GraphQL Endpoints. Testing your API is critical to make sure that the business logic of your software is...
Read more >Test Resource - Ghost Inspector
Testing resources for automated browser tests for your websites and web applications.
Read more >Add getById method to render exports · Issue #183 - GitHub
Here's why a test id is better than class names it the id attribute: https://blog.kentcdodds.com/making-your-ui-tests-resilient-to-change-d37a6ee37269 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We have plans on rewriting the test adapter. We should handle this case there.
/cc @kimadeline
NUL bytes are not allowed in test IDs, since we use it for delimiters internally