PTVS
PTVS copied to clipboard
VS2022 Pytest + pytest-xdist unicode params issue
Describe the bug Test execution from VS2022 will be skipped if test contains unicode symbols in params like π or αΊ, with pytest launched with argument -n/--numprocesses (pytest-xdist)
Steps to Reproduce
- Create pytest test with params containing unicode symbols
- create pytest.ini with [pytest] addopts = -n auto
- Run test from VS2022
Expected behavior Test group executed successfully
Additional context and screenshots
When start test group
When run test separately
Test without pytesx-xdist
Tests without VS
Sample Code
@pytest.mark.parametrize('filter', ['αΊ', 'somedata', 'π'])
def test_cant_get_templates(self, filter):
response = self.some_api_get_with_response_code(filter=filter)
with assert_all('Asserts test_negative_templates_id'):
check_equal(ServiceCode.OK, response.code, f'Return Not {ServiceCode.OK} responce code')
check_equal(CommonConst.EXPECTED_TEMPLATES, response.body,
f'Expected template_id: {CommonConst.EXPECTED_TEMPLATES} '
f'not in response {response.body}')
Configuration information (If you are providing a diagnostics file (see below), skip this section) VS Version: VisualStudio.17.Release/17.3.0+32804.467 PTVS version: 17.0.22179.3 Python version: 3.10