Skip to content

Commit aabf170

Browse files
committed
transaction failure do not need to call obx_txn_abort(), expand version tests
1 parent fd5179c commit aabf170

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

objectbox/transaction.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019-2021 ObjectBox Ltd. All rights reserved.
1+
# Copyright 2019-2023 ObjectBox Ltd. All rights reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -32,6 +32,5 @@ def write(ob: 'ObjectBox'):
3232
yield
3333
obx_txn_success(tx)
3434
except:
35-
obx_txn_abort(tx)
3635
obx_txn_close(tx)
3736
raise

tests/test_basics.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
1+
#
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
114
import objectbox
215
from tests.common import load_empty_test_objectbox
316

417

518
def test_version():
19+
assert objectbox.version.major == 0 # update for major version changes
20+
assert objectbox.version.minor >= 5
21+
22+
assert objectbox.version_core.major == 0 # update for major version changes
23+
assert objectbox.version_core.minor >= 18
24+
625
info = objectbox.version_info()
26+
print("\nVersion found:", info)
727
assert len(info) > 10
28+
assert str(objectbox.version) in info
29+
assert str(objectbox.version_core) in info
830

931

1032
def test_open():

0 commit comments

Comments
 (0)