Skip to content

Commit 2957ffe

Browse files
committed
add oracle test exemption
1 parent 36db084 commit 2957ffe

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CONTRIBUTING.rst

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ justified is acceptable:
5656

5757
.. code-block::
5858
59+
poetry run black django_enum
5960
poetry run isort django_enum
6061
poetry run pylint django_enum
6162
poetry run mypy django_enum

django_enum/tests/tests.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,21 @@ def test_coerce_to_primitive(self):
701701

702702
create_params = {**self.create_params, "no_coerce": "32767"}
703703

704-
tester = self.MODEL_CLASS.objects.create(**create_params)
704+
try:
705+
tester = self.MODEL_CLASS.objects.create(**create_params)
706+
except DatabaseError as err:
707+
print(str(err))
708+
if (
709+
IGNORE_ORA_01843
710+
and connection.vendor == "oracle"
711+
and "ORA-01843" in str(err)
712+
):
713+
# this is an oracle bug - intermittent failure on
714+
# perfectly fine date format in SQL
715+
# TODO - remove when fixed
716+
pytest.skip("Oracle bug ORA-01843 encountered - skipping")
717+
return
718+
raise
705719

706720
self.assertIsInstance(tester.no_coerce, int)
707721
self.assertEqual(tester.no_coerce, 32767)

0 commit comments

Comments
 (0)