Django test command with --parallel

46 views
Skip to first unread message

Yevhen Yevhen

unread,
Jan 9, 2018, 12:22:50 PM1/9/18
to Django users
I try to run my django tests using --parallel flag but get the following error (pastebin). How can I fix this?

Yevhen Yevhen

unread,
Jan 10, 2018, 3:57:54 AM1/10/18
to Django users
The same traceback from the pastebin link:

Creating test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
System check identified no issues (0 silenced).
Traceback (most recent call last):
  File "manage.py", line 41, in <module>
    main()
  File "manage.py", line 37, in main
    execute_from_command_line(sys.argv)
  File "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django/core/management/commands/test.py", line 29, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django/core/management/commands/test.py", line 62, in handle
    failures = test_runner.run_tests(test_labels)
  File "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django/test/runner.py", line 603, in run_tests
    result = self.run_suite(suite)
  File "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django/test/runner.py", line 567, in run_suite
    return runner.run(suite)
  File "/Users/me/.pyenv/versions/3.6.2/lib/python3.6/unittest/runner.py", line 176, in run
    test(result)
  File "/Users/me/.pyenv/versions/3.6.2/lib/python3.6/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
  File "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django/test/runner.py", line 370, in run
    subsuite_index, events = test_results.next(timeout=0.1)
  File "/Users/me/.pyenv/versions/3.6.2/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
  File "/Users/me/.pyenv/versions/3.6.2/lib/python3.6/multiprocessing/pool.py", line 424, in _handle_tasks
    put(task)
  File "/Users/me/.pyenv/versions/3.6.2/lib/python3.6/multiprocessing/connection.py", line 206, in send
    self._send_bytes(_ForkingPickler.dumps(obj))
  File "/Users/me/.pyenv/versions/3.6.2/lib/python3.6/multiprocessing/reduction.py", line 51, in dumps
    cls(buf, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <function TestCase.run at 0x1093db730>: it's not the same object as unittest.case.TestCase.run

Avraham Serour

unread,
Jan 10, 2018, 5:03:44 AM1/10/18
to django-users
does it work without the parallel flag?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3da47ff2-3ab4-40e9-becc-8c06362b1739%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Yevhen Yevhen

unread,
Jan 10, 2018, 5:06:21 AM1/10/18
to Django users
Yes, it works without this flag. And I've found the cause -- custom mixins for TestCase class that performed tricky patching.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages