Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error while running tests. #416

Open
kriyanshishah opened this issue Feb 3, 2024 · 3 comments
Open

Getting error while running tests. #416

kriyanshishah opened this issue Feb 3, 2024 · 3 comments

Comments

@kriyanshishah
Copy link

Hey, I am getting this error while running this command:
python3 manage.py test apps

Traceback (most recent call last):
File "/home/kriyanshi/mercury-2.3.7/mercury/manage.py", line 22, in
main()
File "/home/kriyanshi/mercury-2.3.7/mercury/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/home/kriyanshi/mercury-2.3.7/menv/lib/python3.10/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/home/kriyanshi/mercury-2.3.7/menv/lib/python3.10/site-packages/django/core/management/init.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/kriyanshi/mercury-2.3.7/menv/lib/python3.10/site-packages/django/core/management/commands/test.py", line 24, in run_from_argv
super().run_from_argv(argv)
File "/home/kriyanshi/mercury-2.3.7/menv/lib/python3.10/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/kriyanshi/mercury-2.3.7/menv/lib/python3.10/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
File "/home/kriyanshi/mercury-2.3.7/menv/lib/python3.10/site-packages/django/core/management/commands/test.py", line 68, in handle
failures = test_runner.run_tests(test_labels)
File "/home/kriyanshi/mercury-2.3.7/menv/lib/python3.10/site-packages/django/test/runner.py", line 1048, in run_tests
suite = self.build_suite(test_labels, extra_tests)
File "/home/kriyanshi/mercury-2.3.7/menv/lib/python3.10/site-packages/django/test/runner.py", line 898, in build_suite
tests = self.load_tests_for_label(label, discover_kwargs)
File "/home/kriyanshi/mercury-2.3.7/menv/lib/python3.10/site-packages/django/test/runner.py", line 872, in load_tests_for_label
tests = self.test_loader.discover(start_dir=label, **kwargs)
File "/usr/lib/python3.10/unittest/loader.py", line 349, in discover
tests = list(self._find_tests(start_dir, pattern))
File "/usr/lib/python3.10/unittest/loader.py", line 414, in _find_tests
yield from self._find_tests(full_path, pattern, namespace)
File "/usr/lib/python3.10/unittest/loader.py", line 405, in _find_tests
tests, should_recurse = self._find_test_path(
File "/usr/lib/python3.10/unittest/loader.py", line 458, in _find_test_path
raise ImportError(
ImportError: 'tests' module incorrectly imported from '/home/kriyanshi/mercury-2.3.7/mercury/apps/nb/tests'. Expected '/home/kriyanshi/mercury-2.3.7/mercury/apps/nb'. Is this module globally installed?

@kriyanshishah
Copy link
Author

kriyanshishah commented Feb 4, 2024

ImportError: 'tests' module incorrectly imported from '/home/runner/work/mercury/mercury/mercury/apps/nb/tests'. Expected '/home/runner/work/mercury/mercury/mercury/apps/nb'. Is this module globally installed?

I got this error while pushing changes to main branch.

@pplonski
Copy link
Contributor

pplonski commented Feb 5, 2024

Hi @kriyanshishah,

Hard to say what is the reason.

@codinggeeks06
Copy link

this is django error and its because the way tests are structured.
here is the link: https://stackoverflow.com/questions/37525075/what-does-tests-module-incorrectly-imported-mean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants