You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using python -mcoverage run throws a ModuleNotFoundError error, while using coverage run does not. I use poetry as a dependency and virtual environment manager.
What code are you running?
The master branch of GipHouse/Website.
What commands did you run?
The following steps show how to reproduce the problem.
$ cd /tmp/
$ git clone https://github.com/GipHouse/Website.git
...
$ cd Website
$ poetry install
...
$ poetry run coverage run website/manage.py test
Creating test database foralias'default'...
System check identified no issues (0 silenced).
...........................................................................................................................................
----------------------------------------------------------------------
Ran 139 tests in 3.484s
OK
Destroying test database foralias'default'...
$ poetry run python -mcoverage run website/manage.py test
Traceback (most recent call last):
File "website/manage.py", line 15, in<module>
execute_from_command_line(sys.argv)
File "/home/joren/.cache/pypoetry/virtualenvs/giphousewebsite-PQqkI1vM-py3.8/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/home/joren/.cache/pypoetry/virtualenvs/giphousewebsite-PQqkI1vM-py3.8/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/joren/.cache/pypoetry/virtualenvs/giphousewebsite-PQqkI1vM-py3.8/lib/python3.8/site-packages/django/core/management/commands/test.py", line 23, in run_from_argv
super().run_from_argv(argv)
File "/home/joren/.cache/pypoetry/virtualenvs/giphousewebsite-PQqkI1vM-py3.8/lib/python3.8/site-packages/django/core/management/base.py", line 320, in run_from_argv
parser = self.create_parser(argv[0], argv[1])
File "/home/joren/.cache/pypoetry/virtualenvs/giphousewebsite-PQqkI1vM-py3.8/lib/python3.8/site-packages/django/core/management/base.py", line 294, in create_parser
self.add_arguments(parser)
File "/home/joren/.cache/pypoetry/virtualenvs/giphousewebsite-PQqkI1vM-py3.8/lib/python3.8/site-packages/django/core/management/commands/test.py", line 44, in add_arguments
test_runner_class = get_runner(settings, self.test_runner)
File "/home/joren/.cache/pypoetry/virtualenvs/giphousewebsite-PQqkI1vM-py3.8/lib/python3.8/site-packages/django/test/utils.py", line 301, in get_runner
test_runner_class = test_runner_class or settings.TEST_RUNNER
File "/home/joren/.cache/pypoetry/virtualenvs/giphousewebsite-PQqkI1vM-py3.8/lib/python3.8/site-packages/django/conf/__init__.py", line 76, in __getattr__
self._setup(name)
File "/home/joren/.cache/pypoetry/virtualenvs/giphousewebsite-PQqkI1vM-py3.8/lib/python3.8/site-packages/django/conf/__init__.py", line 63, in _setup
self._wrapped = Settings(settings_module)
File "/home/joren/.cache/pypoetry/virtualenvs/giphousewebsite-PQqkI1vM-py3.8/lib/python3.8/site-packages/django/conf/__init__.py", line 142, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'giphousewebsite'
Expected Behavior
python -mcoverage run and coverage run should both succeed and have the same output.
Additional Context
I noticed a similar problem in #862, but that issue was fixed in 5.0.3 (which I am using).
The text was updated successfully, but these errors were encountered:
Description
Using
python -mcoverage run
throws aModuleNotFoundError
error, while usingcoverage run
does not. I usepoetry
as a dependency and virtual environment manager.To Reproduce
What version of Python are you using?
What version of coverage.py are you using?
What versions of what packages do you have installed?
What code are you running?
The
master
branch of GipHouse/Website.What commands did you run?
The following steps show how to reproduce the problem.
Expected Behavior
python -mcoverage run
andcoverage run
should both succeed and have the same output.Additional Context
I noticed a similar problem in #862, but that issue was fixed in 5.0.3 (which I am using).
The text was updated successfully, but these errors were encountered: