Commit a6c1ffce authored by Marius Gedminas's avatar Marius Gedminas Committed by GitHub

Merge pull request #141 from zopefoundation/use-temp-dir-please

Use a temporary directory in tests
parents bd7cd066 9266c3db
import os
import shutil
import tempfile
import unittest
import zope.testing.setupstack
import zope.testing.setupstack
from BTrees.Length import Length
from ZODB import serialize
from ZODB.DemoStorage import DemoStorage
from ZODB.utils import p64, z64, maxtid
from ZODB.utils import z64, maxtid
from ZODB.broken import find_global
import ZEO
......@@ -111,7 +114,9 @@ class ClientSideConflictResolutionTests(zope.testing.setupstack.TestCase):
def test_client_side(self):
# First, traditional:
addr, stop = ZEO.server('data.fs', threaded=False)
path = tempfile.mkdtemp(prefix='zeo-test-')
self.addCleanup(shutil.rmtree, path)
addr, stop = ZEO.server(os.path.join(path, 'data.fs'), threaded=False)
db = ZEO.DB(addr)
with db.transaction() as conn:
conn.root.l = Length(0)
......
......@@ -5,9 +5,9 @@ envlist =
[testenv]
commands =
# Run unit tests first.
zope-testrunner -u --test-path=src --auto-color --auto-progress
zope-testrunner -u --test-path=src --auto-color --auto-progress {posargs}
# Only run functional tests if unit tests pass.
zope-testrunner -f --test-path=src --auto-color --auto-progress
zope-testrunner -f --test-path=src --auto-color --auto-progress {posargs}
deps =
ZODB >= 4.2.0b1
random2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment