diff options
author | Adam Johnson <me@adamj.eu> | 2021-03-16 12:41:00 +0000 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-18 15:30:47 +0100 |
commit | 92975bcd5f6281d6124f30cd4a71e0adedd78781 (patch) | |
tree | 3a96dba0952a6fb9c7c43ca4b98dfe6a0dc862c4 /tests/test_runner | |
parent | 03d0f12c823239812da21e5180aaa74dc6fd146e (diff) | |
download | django-92975bcd5f6281d6124f30cd4a71e0adedd78781.tar.gz |
Refs #31370 -- Added test for pickling RemoteTestResult.
Diffstat (limited to 'tests/test_runner')
-rw-r--r-- | tests/test_runner/test_parallel.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_runner/test_parallel.py b/tests/test_runner/test_parallel.py index 70959012b5..365c248a43 100644 --- a/tests/test_runner/test_parallel.py +++ b/tests/test_runner/test_parallel.py @@ -1,3 +1,4 @@ +import pickle import unittest from django.test import SimpleTestCase @@ -51,6 +52,11 @@ class SampleFailingSubtest(SimpleTestCase): class RemoteTestResultTest(SimpleTestCase): + def test_picklable(self): + result = RemoteTestResult() + loaded_result = pickle.loads(pickle.dumps(result)) + self.assertEqual(result.events, loaded_result.events) + def test_pickle_errors_detection(self): picklable_error = RuntimeError('This is fine') not_unpicklable_error = ExceptionThatFailsUnpickling('arg') |