Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit 3f4ef64

Browse files
author
Ilya Gurov
authored
test: skip null/numeric related tests on emulator (#94)
1 parent 02b4674 commit 3f4ef64

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,19 @@ with engine.begin() as connection:
204204
```
205205
Connectionless way of use is also deprecated since SQLAlchemy 2.0 and soon will be removed (see in [SQLAlchemy docs](https://docs.sqlalchemy.org/en/14/core/connections.html#connectionless-execution-implicit-execution)).
206206

207+
Running tests
208+
------------
209+
Spanner dialect includes a compliance, migration and unit test suite. To run the tests the `nox` package commands can be used:
210+
```
211+
# Run the whole suite
212+
$ nox
213+
214+
# Run a particular test session
215+
$ nox -s migration_test
216+
```
217+
**Running tests on Spanner emulator**
218+
The dialect test suite can be runned on [Spanner emulator](https://cloud.google.com/spanner/docs/emulator). Several tests, relating to `NULL` values of data types, are skipped when executed on emulator.
219+
207220
Contributing
208221
------------
209222

test/test_suite.py

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
import decimal
1718
import operator
19+
import os
1820
import pytest
19-
import decimal
2021
import pytz
2122
from unittest import mock
2223

@@ -329,7 +330,17 @@ class DateTest(DateFixtureTest, _DateTest):
329330
and maintain DRY concept just inherit the class to run tests successfully.
330331
"""
331332

332-
pass
333+
@pytest.mark.skipif(
334+
bool(os.environ.get("SPANNER_EMULATOR_HOST")), reason="Skipped on emulator"
335+
)
336+
def test_null_bound_comparison(self):
337+
super().test_null_bound_comparison()
338+
339+
@pytest.mark.skipif(
340+
bool(os.environ.get("SPANNER_EMULATOR_HOST")), reason="Skipped on emulator"
341+
)
342+
def test_null(self):
343+
super().test_null()
333344

334345

335346
class DateTimeMicrosecondsTest(_DateTimeMicrosecondsTest, DateTest):
@@ -349,6 +360,18 @@ def test_round_trip(self):
349360
eq_(row[0].rfc3339(), compare)
350361
assert isinstance(row[0], DatetimeWithNanoseconds)
351362

363+
@pytest.mark.skipif(
364+
bool(os.environ.get("SPANNER_EMULATOR_HOST")), reason="Skipped on emulator"
365+
)
366+
def test_null_bound_comparison(self):
367+
super().test_null_bound_comparison()
368+
369+
@pytest.mark.skipif(
370+
bool(os.environ.get("SPANNER_EMULATOR_HOST")), reason="Skipped on emulator"
371+
)
372+
def test_null(self):
373+
super().test_null()
374+
352375

353376
class DateTimeTest(_DateTimeTest, DateTimeMicrosecondsTest):
354377
"""
@@ -359,7 +382,17 @@ class DateTimeTest(_DateTimeTest, DateTimeMicrosecondsTest):
359382
tests successfully.
360383
"""
361384

362-
pass
385+
@pytest.mark.skipif(
386+
bool(os.environ.get("SPANNER_EMULATOR_HOST")), reason="Skipped on emulator"
387+
)
388+
def test_null_bound_comparison(self):
389+
super().test_null_bound_comparison()
390+
391+
@pytest.mark.skipif(
392+
bool(os.environ.get("SPANNER_EMULATOR_HOST")), reason="Skipped on emulator"
393+
)
394+
def test_null(self):
395+
super().test_null()
363396

364397

365398
@pytest.mark.skip("Spanner doesn't support Time data type.")

0 commit comments

Comments
 (0)