When I run stestr tests, these tests fail everytime.
$ stestr failing
======================================================================
FAIL: stestr.tests.test_return_codes.TestReturnCodesToxIni.test_no_repo_dir
tags: worker-5
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/migawa/git/stestr/stestr/tests/test_return_codes.py", line 233, in test_no_repo_dir
self.assertRunExit("stestr run passing", 0)
File "/home/migawa/git/stestr/stestr/tests/test_return_codes.py", line 99, in assertRunExit
self.assertEqual(
File "/home/migawa/.local/lib/python3.12/site-packages/testtools/testcase.py", line 395, in assertEqual
self.assertThat(observed, matcher, message)
File "/home/migawa/.local/lib/python3.12/site-packages/testtools/testcase.py", line 482, in assertThat
raise mismatch_error
testtools.matchers._impl.MismatchError: 1 != 0: Stdout: b''; Stderr: b'module \'configparser\' has no attribute \'SafeConfigParser\'\nTraceback (most recent call last):\n File "/home/migawa/git/stestr/stestr/repository/file.py", line 60, in open\n stream = open(os.path.join(base, "format"))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/tmp/stestr-unit8d7f9bd_/.stestr/format\'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/home/migawa/git/stestr/stestr/commands/run.py", line 470, in run_command\n repo = util.get_repo_open(repo_url=repo_url)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/home/migawa/git/stestr/stestr/repository/util.py", line 45, in get_repo_open\n return repo_module.RepositoryFactory().open(repo_url)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/home/migawa/git/stestr/stestr/repository/file.py", line 63, in open\n raise repository.RepositoryNotFound(url)\nstestr.repository.abstract.RepositoryNotFound: No repository found in /tmp/stestr-unit8d7f9bd_. Create one by running "stestr init".\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/home/migawa/.local/lib/python3.12/site-packages/cliff/app.py", line 410, in run_subcommand\n result = cmd.run(parsed_args)\n ^^^^^^^^^^^^^^^^^^^^\n File "/home/migawa/.local/lib/python3.12/site-packages/cliff/command.py", line 181, in run\n return_code = self.take_action(parsed_args) or 0\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/home/migawa/git/stestr/stestr/commands/run.py", line 309, in take_action\n result = run_command(\n ^^^^^^^^^^^^\n File "/home/migawa/git/stestr/stestr/commands/run.py", line 476, in run_command\n tox_conf = configparser.SafeConfigParser()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: module \'configparser\' has no attribute \'SafeConfigParser\'. Did you mean: \'RawConfigParser\'?\n'
======================================================================
FAIL: stestr.tests.test_return_codes.TestReturnCodesToxIni.test_empty_repo_dir
tags: worker-2
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/migawa/git/stestr/stestr/tests/test_return_codes.py", line 240, in test_empty_repo_dir
self.assertRunExit("stestr run passing", 0)
File "/home/migawa/git/stestr/stestr/tests/test_return_codes.py", line 99, in assertRunExit
self.assertEqual(
File "/home/migawa/.local/lib/python3.12/site-packages/testtools/testcase.py", line 395, in assertEqual
self.assertThat(observed, matcher, message)
File "/home/migawa/.local/lib/python3.12/site-packages/testtools/testcase.py", line 482, in assertThat
raise mismatch_error
testtools.matchers._impl.MismatchError: 1 != 0: Stdout: b''; Stderr: b'module \'configparser\' has no attribute \'SafeConfigParser\'\nTraceback (most recent call last):\n File "/home/migawa/git/stestr/stestr/repository/file.py", line 60, in open\n stream = open(os.path.join(base, "format"))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/tmp/stestr-unitldbt_6m6/.stestr/format\'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/home/migawa/git/stestr/stestr/commands/run.py", line 470, in run_command\n repo = util.get_repo_open(repo_url=repo_url)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/home/migawa/git/stestr/stestr/repository/util.py", line 45, in get_repo_open\n return repo_module.RepositoryFactory().open(repo_url)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/home/migawa/git/stestr/stestr/repository/file.py", line 63, in open\n raise repository.RepositoryNotFound(url)\nstestr.repository.abstract.RepositoryNotFound: No repository found in /tmp/stestr-unitldbt_6m6. Create one by running "stestr init".\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/home/migawa/.local/lib/python3.12/site-packages/cliff/app.py", line 410, in run_subcommand\n result = cmd.run(parsed_args)\n ^^^^^^^^^^^^^^^^^^^^\n File "/home/migawa/.local/lib/python3.12/site-packages/cliff/command.py", line 181, in run\n return_code = self.take_action(parsed_args) or 0\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/home/migawa/git/stestr/stestr/commands/run.py", line 309, in take_action\n result = run_command(\n ^^^^^^^^^^^^\n File "/home/migawa/git/stestr/stestr/commands/run.py", line 476, in run_command\n tox_conf = configparser.SafeConfigParser()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: module \'configparser\' has no attribute \'SafeConfigParser\'. Did you mean: \'RawConfigParser\'?\n'
Ran 2 tests in 6.935s
FAILED (id=5, failures=2)
$ pip freeze
alabaster==0.7.16
attrs==23.2.0
autopage==0.5.2
Babel==2.14.0
black==22.12.0
certifi==2024.2.2
charset-normalizer==3.3.2
click==8.1.7
cliff==4.6.0
cmd2==2.4.3
coverage==7.4.4
ddt==1.7.2
doc8==1.1.1
docutils==0.20.1
fixtures==4.1.0
flake8==3.8.4
hacking==3.1.0
idna==3.6
imagesize==1.4.1
iso8601==2.1.0
Jinja2==3.1.3
MarkupSafe==2.1.5
mccabe==0.6.1
mypy-extensions==1.0.0
packaging==24.0
pathspec==0.12.1
pbr==6.0.0
platformdirs==4.2.0
prettytable==3.10.0
pycodestyle==2.6.0
pyflakes==2.2.0
Pygments==2.17.2
pyperclip==1.8.2
python-subunit==1.4.4
PyYAML==6.0.1
requests==2.31.0
restructuredtext_lint==1.4.0
setuptools==69.2.0
snowballstemmer==2.2.0
Sphinx==7.2.6
sphinxcontrib-applehelp==1.0.8
sphinxcontrib-devhelp==1.0.6
sphinxcontrib-htmlhelp==2.0.5
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.7
sphinxcontrib-serializinghtml==1.1.10
stevedore==5.2.0
testtools==2.7.1
urllib3==2.2.1
voluptuous==0.14.2
wcwidth==0.2.13
$ python --version
Python 3.11.8
$ stestr --version
stestr 4.0.1.dev14
$ stestr failing
PASSED (id=13)
Issue description
When I run stestr tests, these tests fail everytime.
Expected behavior and actual behavior
Expected: No failures
Actual:
Steps to reproduce the problem
stestr runon the environment like below.Specifications like the version of the project, operating system, or hardware
System information
stestr --version):stestr 4.0.1.dev15python --version):Python 3.12.2pip freeze):Additional information
I'm facing two failures on
stestr.tests.test_return_codes.TestReturnCodesToxIni.test_no_repo_dirandstestr.tests.test_return_codes.TestReturnCodesToxIni.test_empty_repo_dir. And it seems that the same error happens in both tests.This issue doesn't happen on
python 3.11.8on my environment(Fedora39) somehow.