azure-cli-dev-tools icon indicating copy to clipboard operation
azure-cli-dev-tools copied to clipboard

test_service_scenario.py test fails with syntax error

Open glaubitz opened this issue 3 years ago • 0 comments

I'm currently packaging azdev for openSUSE Tumbleweed:

See: https://build.opensuse.org/package/show/home:glaubitz:branches:Cloud:Tools/azdev

The testsuite currently fails in test_service_scenario.py with a syntax error, even on Python 3.8 (since Python 3.9 and 3.10 are not recommended):

[    9s] + pytest-3.8 --ignore=_build. --ignore=_build.python38 -v
[    9s] ============================= test session starts ==============================
[    9s] platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3.8
[    9s] cachedir: .pytest_cache
[    9s] rootdir: /home/abuild/rpmbuild/BUILD/azdev-0.1.36
[    9s] plugins: xdist-2.5.0, forked-1.3.0
[    9s] collecting ... collected 0 items / 1 error
[    9s] 
[    9s] ==================================== ERRORS ====================================
[    9s] ________ ERROR collecting azdev/mod_templates/test_service_scenario.py _________
[    9s] /usr/lib/python3.8/site-packages/_pytest/python.py:578: in _importtestmodule
[    9s]     mod = import_path(self.fspath, mode=importmode)
[    9s] /usr/lib/python3.8/site-packages/_pytest/pathlib.py:524: in import_path
[    9s]     importlib.import_module(module_name)
[    9s] /usr/lib64/python3.8/importlib/__init__.py:127: in import_module
[    9s]     return _bootstrap._gcd_import(name[level:], package, level)
[    9s] <frozen importlib._bootstrap>:1014: in _gcd_import
[    9s]     ???
[    9s] <frozen importlib._bootstrap>:991: in _find_and_load
[    9s]     ???
[    9s] <frozen importlib._bootstrap>:975: in _find_and_load_unlocked
[    9s]     ???
[    9s] <frozen importlib._bootstrap>:671: in _load_unlocked
[    9s]     ???
[    9s] /usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:161: in exec_module
[    9s]     source_stat, co = _rewrite_test(fn, self.config)
[    9s] /usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:362: in _rewrite_test
[    9s]     tree = ast.parse(source, filename=fn_)
[    9s] /usr/lib64/python3.8/ast.py:47: in parse
[    9s]     return compile(source, filename, mode, flags,
[    9s] E     File "/home/abuild/rpmbuild/BUILD/azdev-0.1.36/azdev/mod_templates/test_service_scenario.py", line 16
[    9s] E       class {{ name.capitalize() }}ScenarioTest(ScenarioTest):
[    9s] E             ^
[    9s] E   SyntaxError: invalid syntax
[    9s] =========================== short test summary info ============================
[    9s] ERROR azdev/mod_templates/test_service_scenario.py
[    9s] !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
[    9s] =============================== 1 error in 0.16s ===============================

glaubitz avatar Mar 18 '22 10:03 glaubitz