Running tests in circle fails with tests incorrectly imported from a virtualenv, (rather than the project,) despite the same command working on my local machine. This is painful to debug in the circle ecosystem; any thoughts on the likely cause of divergence? I have tried hacking a pythonpath in an override of the test call to no avail. A guess in the dark: is circle making bad assumptions given my project’s having a setup.py? This is on a dopey personal blog project, so you can check out the code and inspect it if you want.
Stacktrace:
python test_project/manage.py testTraceback (most recent call last):
File "test_project/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/ubuntu/virtualenvs/venv-2.7.5/lib/python2.7/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
utility.execute()
File "/home/ubuntu/virtualenvs/venv-2.7.5/lib/python2.7/site-packages/django/core/management/__init__.py", line 342, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ubuntu/virtualenvs/venv-2.7.5/lib/python2.7/site-packages/django/core/management/commands/test.py", line 30, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/home/ubuntu/virtualenvs/venv-2.7.5/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/ubuntu/virtualenvs/venv-2.7.5/lib/python2.7/site-packages/django/core/management/commands/test.py", line 74, in execute
super(Command, self).execute(*args, **options)
File "/home/ubuntu/virtualenvs/venv-2.7.5/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/home/ubuntu/virtualenvs/venv-2.7.5/lib/python2.7/site-packages/django/core/management/commands/test.py", line 90, in handle
failures = test_runner.run_tests(test_labels)
File "/home/ubuntu/virtualenvs/venv-2.7.5/lib/python2.7/site-packages/django/test/runner.py", line 531, in run_tests
suite = self.build_suite(test_labels, extra_tests)
File "/home/ubuntu/virtualenvs/venv-2.7.5/lib/python2.7/site-packages/django/test/runner.py", line 451, in build_suite
tests = self.test_loader.discover(start_dir=label, **kwargs)
File "/home/ubuntu/.pyenv/versions/2.7.5/lib/python2.7/unittest/loader.py", line 204, in discover
tests = list(self._find_tests(start_dir, pattern))
File "/home/ubuntu/.pyenv/versions/2.7.5/lib/python2.7/unittest/loader.py", line 285, in _find_tests
for test in self._find_tests(full_path, pattern):
File "/home/ubuntu/.pyenv/versions/2.7.5/lib/python2.7/unittest/loader.py", line 265, in _find_tests
raise ImportError(msg % (mod_name, module_dir, expected_dir))
ImportError:
'tests' module incorrectly imported from
'/home/ubuntu/virtualenvs/venv-2.7.5/src/django-basic-blog-master/blog'.
Expected '/home/ubuntu/django-basic-blog/blog'. Is this module globally
installed?
python test_project/manage.py test returned exit code 1
Circle config:
machine:
python:
version: 2.7.5
test:
override:
- python test_project/manage.py test
dependencies:
override:
- pip install -r test_project/requirements/test.py; pip install coveralls