Skip to content

Commit

Permalink
Skip tests for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Dec 21, 2024
1 parent c4cc3cb commit 6afbcd2
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tests/test_mdbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import ctypes
import inspect

import sys
import subprocess
import random
import unittest
Expand Down Expand Up @@ -189,18 +190,20 @@ def test_env(self):
dbi=txn.open_map()
dbi.put(txn, MDBX_TEST_KEY, MDBX_TEST_VAL_UTF8)
txn.commit()
path="%s/%s" % (MDBX_TEST_DB_DIR, "copy")
with open(path, "w") as fd:
env.copy2fd(fd, libmdbx.MDBXCopyMode.MDBX_CP_DEFAULTS | libmdbx.MDBXCopyMode.MDBX_CP_FORCE_DYNAMIC_SIZE)

if sys.platform != "win32":
path="%s/%s" % (MDBX_TEST_DB_DIR, "copy")
with open(path, "w") as fd:
env.copy2fd(fd, libmdbx.MDBXCopyMode.MDBX_CP_DEFAULTS | libmdbx.MDBXCopyMode.MDBX_CP_FORCE_DYNAMIC_SIZE)

self.assertTrue(os.path.exists(path))
self.assertTrue(os.stat(path).st_size > 0)
self.assertTrue(os.path.exists(path))
self.assertTrue(os.stat(path).st_size > 0)

txn=env.start_transaction()
old=dbi.replace(txn, MDBX_TEST_KEY, MDBX_TEST_VAL_BINARY)
self.assertEqual(old, MDBX_TEST_VAL_UTF8)
txn=env.start_transaction()
old=dbi.replace(txn, MDBX_TEST_KEY, MDBX_TEST_VAL_BINARY)
self.assertEqual(old, MDBX_TEST_VAL_UTF8)

txn.commit()
txn.commit()

env.close()

Expand Down

0 comments on commit 6afbcd2

Please sign in to comment.