File: 0002-Skip-concurrent-transaction-test-if-SQLite-is-used.patch

package info (click to toggle)
python-django-celery-results 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 696 kB
  • sloc: python: 2,373; makefile: 312; sh: 7; sql: 2
file content (29 lines) | stat: -rw-r--r-- 1,013 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Michael Fladischer <FladischerMichael@fladi.at>
Date: Mon, 30 Nov 2020 20:50:21 +0100
Subject: Skip concurrent transaction test if SQLite is used.

---
 t/unit/test_models.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/unit/test_models.py b/t/unit/test_models.py
index e655f4c..7489570 100644
--- a/t/unit/test_models.py
+++ b/t/unit/test_models.py
@@ -3,7 +3,7 @@ from unittest.mock import patch
 
 import pytest
 from celery import states, uuid
-from django.db import transaction
+from django.db import transaction, connection
 from django.db.utils import InterfaceError
 from django.test import TransactionTestCase
 
@@ -64,6 +64,7 @@ class test_Models(TransactionTestCase):
         )
         assert m1 not in TaskResult.objects.all()
 
+    @pytest.mark.skipif(connection.vendor == "sqlite", reason="Concurrent transactions not supported by SQLite")
     def test_store_result(self, ctype='application/json', cenc='utf-8'):
         """
         Test the `using` argument.